CS 1332 Final Exam Questions With
Correct Answers
Dijkstra's |Time |Complexity |- |CORRECT |ANSWER✔✔-O((V |+ |E) |log(V))
Prim's |Time |Complexity |- |CORRECT |ANSWER✔✔-O((V |+ |E) |log(V))
Kruskal's |Time |Complexity |- |CORRECT |ANSWER✔✔-O((V |+ |E) |log(V))
Brute |Force |(Pattern |Matching) |Avg/Worst |Case |- |CORRECT |ANSWER✔✔-O(mn)
Boyer-Moore |Avg |Case |- |CORRECT |ANSWER✔✔-O(m |+ |n)
Boyer-Moore |Worst |Case |- |CORRECT |ANSWER✔✔-O(mn)
Floyd-Warshall |- |CORRECT |ANSWER✔✔-O(V^3)
LCS |- |CORRECT |ANSWER✔✔-O(mn)
Rabin-Karp |Worst |Case |- |CORRECT |ANSWER✔✔-O(mn)
Rabin-Karp |Avg |Case |- |CORRECT |ANSWER✔✔-O(m |+ |n)
KMP |Best/Avg/Worst |Case |- |CORRECT |ANSWER✔✔-O(m |+ |n)
, Bubble |Sort |best |case |- |CORRECT |ANSWER✔✔-O(n)
Bubble |Sort |Avg/Worst |case |- |CORRECT |ANSWER✔✔-O(n^2)
Bubble |Sort |stability |- |CORRECT |ANSWER✔✔-stable
Bubble |sort |in |place? |- |CORRECT |ANSWER✔✔-In-place
Cocktail |Sort |Best |case |- |CORRECT |ANSWER✔✔-O(n)
Cocktail |Sort |Avg/Worst |case |- |CORRECT |ANSWER✔✔-O(n^2)
Cocktail |Sort |stability |- |CORRECT |ANSWER✔✔-stable
Cocktail |Sort |in |place? |- |CORRECT |ANSWER✔✔-In-place
Insertion |Sort |best |case |- |already |sorted |- |CORRECT |ANSWER✔✔-O(n)
Insertion |Sort |avg/worst |case |- |CORRECT |ANSWER✔✔-O(n^2)
Insertion |sort |stability |- |CORRECT |ANSWER✔✔-stable
Insertion |Sort |in |place? |- |CORRECT |ANSWER✔✔-In-place
Selection |Sort |best/avg/worst |- |CORRECT |ANSWER✔✔-O(n^2)
Correct Answers
Dijkstra's |Time |Complexity |- |CORRECT |ANSWER✔✔-O((V |+ |E) |log(V))
Prim's |Time |Complexity |- |CORRECT |ANSWER✔✔-O((V |+ |E) |log(V))
Kruskal's |Time |Complexity |- |CORRECT |ANSWER✔✔-O((V |+ |E) |log(V))
Brute |Force |(Pattern |Matching) |Avg/Worst |Case |- |CORRECT |ANSWER✔✔-O(mn)
Boyer-Moore |Avg |Case |- |CORRECT |ANSWER✔✔-O(m |+ |n)
Boyer-Moore |Worst |Case |- |CORRECT |ANSWER✔✔-O(mn)
Floyd-Warshall |- |CORRECT |ANSWER✔✔-O(V^3)
LCS |- |CORRECT |ANSWER✔✔-O(mn)
Rabin-Karp |Worst |Case |- |CORRECT |ANSWER✔✔-O(mn)
Rabin-Karp |Avg |Case |- |CORRECT |ANSWER✔✔-O(m |+ |n)
KMP |Best/Avg/Worst |Case |- |CORRECT |ANSWER✔✔-O(m |+ |n)
, Bubble |Sort |best |case |- |CORRECT |ANSWER✔✔-O(n)
Bubble |Sort |Avg/Worst |case |- |CORRECT |ANSWER✔✔-O(n^2)
Bubble |Sort |stability |- |CORRECT |ANSWER✔✔-stable
Bubble |sort |in |place? |- |CORRECT |ANSWER✔✔-In-place
Cocktail |Sort |Best |case |- |CORRECT |ANSWER✔✔-O(n)
Cocktail |Sort |Avg/Worst |case |- |CORRECT |ANSWER✔✔-O(n^2)
Cocktail |Sort |stability |- |CORRECT |ANSWER✔✔-stable
Cocktail |Sort |in |place? |- |CORRECT |ANSWER✔✔-In-place
Insertion |Sort |best |case |- |already |sorted |- |CORRECT |ANSWER✔✔-O(n)
Insertion |Sort |avg/worst |case |- |CORRECT |ANSWER✔✔-O(n^2)
Insertion |sort |stability |- |CORRECT |ANSWER✔✔-stable
Insertion |Sort |in |place? |- |CORRECT |ANSWER✔✔-In-place
Selection |Sort |best/avg/worst |- |CORRECT |ANSWER✔✔-O(n^2)