• ¿Documento equivocado? Cámbialo gratis
  • Escrito por estudiantes que aprobaron
  • Inmediatamente disponible después del pago
  • Leer en línea o como PDF
Vender
¿Dónde estudias?
Tu idioma
Document preview thumbnail
Vista previa 3 fuera de 21 páginas
Examen

Cs6515 Exam 2 2026/2027 Actual Questions With Verified Answers.

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

CS6515 EXAM 2 2026/2027 ACTUAL QUESTIONS WITH VERIFIED ANSWERS.

Vista previa del contenido

CS6515 EXAM 2 2026/2027
ACTUAL QUESTIONS WITH
VERIFIED ANSWERS.

BFS Algorithm - correct answer -Input: Directed or Undirected
Graph G, and start vertex s


Output:
1. dist[u] - distance from s to u if s can reach u, inf otherwise
2. prev[z] - the parent index of vertex z


Runtime: O(m+n)


- Use this for unweighted Single Source Shortest Path
- Dist is given as the number of edges from s to u, not the sum of
weights




DFS Algorithm - correct answer -Input: Graph G


Output:
1. prev[z] - parent index of vertex z

,2. pre[z] - pre number of vertex z
3. post[z] - post number of vertex z
4. ccnum[z] - connected component number of z


Runtime: O(m+n)




Dijkstra's Algorithm - correct answer -Input: Graph (directed/un-
directed), Start vertex.


Output:
1. dist[u] - distance from s to u if s can reach u
2. prev[z] - parent index of vertex z


Runtime: O( (n + m) * log(n) )


More sophisticated BFS that utilizes miniheap data structure.
Such requires an additional log(n) time over BFS because of this




SCC Algorithm - correct answer -Input: Directed Graph


Output:
1. Metagraph of G.

, 2. Connected Component Numbers for each vertex (this comes
from DFS, explained above)


Runtime: O(n + m)




Kruskal Algorithm - correct answer -Input: connected undirected
graph G, edge weights w


Output: minimum spanning tree defined by the edges


Runtime: O(m log(m)) or O(m log(n))
Input: Connected, undirected graph. (Must have edge weights...
basis of algo)




How it works: Basically Sorts edges from least to greatest and
starts building the tree.




Prim's Algorithm - correct answer -Runtime: O(m log(m)) or O(m
log(n))
Input: Connected, undirected graph. (Must have edge weights...
basis of algo)
Output: The Minimum Spanning Tree of the graph.

Información del documento

Subido en
29 de septiembre de 2026
Número de páginas
21
Escrito en
2026/2027
Tipo
Examen
Contiene
Preguntas y respuestas
$16.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.
Savvynurse
3.6
(58)
Vendido
258
Seguidores
7
Artículos
7863
Última venta
1 semana 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