Algorithms and Complexity MCQs (Part-14)

What does Big O notation represent?

A Exact bound
B Best case
C Upper bound
D Lower bound

What is the time complexity of Bubble Sort in the worst case?

A O(n²)
B O(n)
C O(n log n)
D O(log n)

What is the space complexity of Quick Sort?

A O(n)
B O(log n)
C O(1)
D O(n log n)

What does Theta notation represent?

A Worst case
B Exact bound
C Lower bound
D Upper bound

Which algorithm is an example of Divide and Conquer?

A Merge Sort
B Binary Search
C Quick Sort
D All of the above

Which of these is an optimal solution for the Knapsack problem?

A Dynamic Programming
B Backtracking
C Greedy Algorithm
D Brute Force

Which of these algorithms is used to find the shortest path in a graph?

A Heap Sort
B Binary Search
C Dijkstra’s Algorithm
D Merge Sort

What is the time complexity of Merge Sort?

A O(n)
B O(n²)
C O(n log n)
D O(log n)

What does the “Omega” notation describe?

A Worst case
B Upper bound
C Best case
D Exact bound

What is the primary feature of Greedy algorithms?

A Makes locally optimal choices
B Solves all problems optimally
C Guarantees exact solutions
D Uses dynamic programming

Which of the following algorithms is used to find the longest common subsequence?

A Merge Sort
B Dynamic Programming
C Quick Sort
D Binary Search

Which of the following problems is NP-Complete?

A Longest Path Problem
B Binary Search
C Sorting an array
D Matrix multiplication

Which algorithm is used for binary search in a sorted array?

A Heap Sort
B Merge Sort
C Binary Search
D Quick Sort

What is the time complexity of Insertion Sort in the worst case?

A O(n log n)
B O(n)
C O(log n)
D O(n²)

What is the space complexity of Binary Search?

A O(n)
B O(n log n)
C O(log n)
D O(1)