DSA EXAM QUESTIONS WITH
CORRECT ANSWERS
Big O of Bubble sort - Correct Answers -Best: O(n)
Average & Worst: O(n^2)
Big O of linear search - Correct Answers -O(n)
Big O of Merge Sort - Correct Answers -O(nlogn)
Big O of - Correct Answers -
How many elements in a list of size N would be visited when using a binary search for a
number that is larger than all the values in the list - Correct Answers -log2(N) ex:
log2(64) = 6
inorder traversal - Correct Answers -left, root, right
Push(queue, x) - Correct Answers -Inserts x at end of the queue
Pop(queue) - Correct Answers -Returns and removes item at front of queue
How many elements in a list of size N would be visited when using a binary search for a
number that is smaller than all the values in the list - Correct Answers -log2(N) ex:
log2(64) = 6
Exponential Run Time - Correct Answers -N^2
Post-Order Traversal - Correct Answers -left, right, root
CORRECT ANSWERS
Big O of Bubble sort - Correct Answers -Best: O(n)
Average & Worst: O(n^2)
Big O of linear search - Correct Answers -O(n)
Big O of Merge Sort - Correct Answers -O(nlogn)
Big O of - Correct Answers -
How many elements in a list of size N would be visited when using a binary search for a
number that is larger than all the values in the list - Correct Answers -log2(N) ex:
log2(64) = 6
inorder traversal - Correct Answers -left, root, right
Push(queue, x) - Correct Answers -Inserts x at end of the queue
Pop(queue) - Correct Answers -Returns and removes item at front of queue
How many elements in a list of size N would be visited when using a binary search for a
number that is smaller than all the values in the list - Correct Answers -log2(N) ex:
log2(64) = 6
Exponential Run Time - Correct Answers -N^2
Post-Order Traversal - Correct Answers -left, right, root