Docsity

CMPSC 465 Algorithm Complexities Exam #1 Questions with Correct Answers, Exams of Nursing

Toggle sidebar
bg1
CMPSC 465 Algorithm Complexities Exam #1 Questions with
Correct Answers
QuickSort - โœ”โœ”Average TC: ๐œƒ(n log n)
Worst-case TC: ๐œƒ(nยฒ)
SC: O(n)
RandomSelect - โœ”โœ”TC: ๐œƒ(n)
SC: O(n)
MoMSelect - โœ”โœ”TC: O(n)
SC: O(n)
MoMSort - โœ”โœ”TC: O(n log n)
SC: O(n)
LinearSearch - โœ”โœ”TC: ๐œƒ(n)
SC: O(n)
BinarySearch - โœ”โœ”TC: O(log n)
SC: O(n)
HeapSort - โœ”โœ”TC: O(n log n)
SC: O(n)
pf3

Partial preview of the text

Download CMPSC 465 Algorithm Complexities Exam #1 Questions with Correct Answers and more Exams Nursing in PDF only on Docsity!

CMPSC 465 Algorithm Complexities Exam #1 Questions with

Correct Answers

QuickSort - โœ”โœ”Average TC: ๐œƒ(n log n) Worst-case TC: ๐œƒ(nยฒ) SC: O(n) RandomSelect - โœ”โœ”TC: ๐œƒ(n) SC: O(n) MoMSelect - โœ”โœ”TC: O(n) SC: O(n) MoMSort - โœ”โœ”TC: O(n log n) SC: O(n) LinearSearch - โœ”โœ”TC: ๐œƒ(n) SC: O(n) BinarySearch - โœ”โœ”TC: O(log n) SC: O(n) HeapSort - โœ”โœ”TC: O(n log n) SC: O(n)

BuildHeap - โœ”โœ”TC: O(n) SC: O(1) MergeSort - โœ”โœ”TC: O(n log n) SC: O(n) InsertionSort - โœ”โœ”TC: O(nยฒ) SC: O(1) Graph-Traversal Algorithms (BFS/DFS/SCCFinder/TopologicalSort) - โœ”โœ”TC: O(|V|

  • |E|) SC: O(|V| + |E|) Dijkstra's - โœ”โœ”TC: O( (|V| + |E|) log|V|) SC: O(|V|) Bellman-Ford - โœ”โœ”TC: O(|V| * |E|) SC: O(|V|) Floyd-Warshall - โœ”โœ”TC: O(|V|ยณ) SC: O(|V|ยฒ) Linear DP Algorithms - โœ”โœ”TC: O(nยฒ)/O(n log n) SC: O(n)