Escrito por estudiantes que aprobaron Inmediatamente disponible después del pago Leer en línea o como PDF ¿Documento equivocado? Cámbialo gratis 4,6 TrustPilot
logo-home
Document preview thumbnail
Vista previa 3 fuera de 29 páginas
Examen

CS 302 Midterm Questions and Answers with Verified Solutions | Latest 2026 Update

Document preview thumbnail
Vista previa 3 fuera de 29 páginas

CS 302 Midterm Questions and Answers with Verified Solutions | Latest 2026 Update

Vista previa del contenido

CS 302 Midterm Questions and Answers with Verified Solutions |
Latest 2026 Update




Q: What is the reason for using an adjacency matrix instead of an adjacency list to
represent a graph?

Answer:
- allow you to check if an edge exists between two vertices in O(1) time if graph is
dense (a lot of edges) then a matrix is more space efficient

Q: what data structure is commonly used to implement a graph

Answer:
adjacency list

Q: What is the worst-case scenario for quick sort?

Answer:
O(n^2)

, CS 302 Midterm Questions and Answers with Verified Solutions |
Latest 2026 Update




Q: What algorithm is used to find the shortest path from x node to y node in a
weighted graph?

Answer:
Dijkstra's

Q: Which sorting algorithm always used a pivot to partition the data

Answer:
quick sort

Q: What is the Big O running time for merge sort

Answer:
n log n

Q: Which of the following is true about Dijkstra's algorithm

Answer:
Dijkstra's algorithm uses a priority
queue to select the next node with the smallest known distance.

, CS 302 Midterm Questions and Answers with Verified Solutions |
Latest 2026 Update




Q: Which sorting algorithm is theoretically the fastest

Answer:
merge/quick sort

Q: What does DFS stand for

Answer:
Depth First Search

Q: Which graph searching algorithm should not be implemented recursively

Answer:
BFS

Q: What does Dijkstra's algorithm do

Answer:
Find the shortest path between two vertices.

Información del documento

Subido en
9 de julio de 2026
Número de páginas
29
Escrito en
2025/2026
Tipo
Examen
Contiene
Preguntas y respuestas
$13.99

¿Documento equivocado? Cámbialo gratis Dentro de los 14 días posteriores a la compra y antes de descargarlo, puedes elegir otro documento. Puedes gastar el importe de nuevo.
Escrito por estudiantes que aprobaron
Inmediatamente disponible después del pago
Leer en línea o como PDF

Seller avatar
Los indicadores de reputación están sujetos a la cantidad de artículos vendidos por una tarifa y las reseñas que ha recibido por esos documentos. Hay tres niveles: Bronce, Plata y Oro. Cuanto mayor reputación, más podrás confiar en la calidad del trabajo del vendedor.
SpencerHenderson
3.7
(53)
Vendido
263
Seguidores
117
Artículos
45452
Última venta
23 horas hace


Por qué los estudiantes eligen Stuvia

Creado por compañeros estudiantes, verificado por reseñas

Calidad en la que puedes confiar: escrito por estudiantes que aprobaron y evaluado por otros que han usado estos resúmenes.

¿No estás satisfecho? Elige otro documento

¡No te preocupes! Puedes elegir directamente otro documento que se ajuste mejor a lo que buscas.

Paga como quieras, empieza a estudiar al instante

Sin suscripción, sin compromisos. Paga como estés acostumbrado con tarjeta de crédito y descarga tu documento PDF inmediatamente.

Student with book image

“Comprado, descargado y aprobado. Así de fácil puede ser.”

Alisha Student

Preguntas frecuentes