Algorithms and Complexity MCQs (Part-13)

What does Big O notation represent?

A Optimal case
B Best case
C Worst case
D Average case

What is the time complexity of Merge Sort?

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

What is the primary use of a greedy algorithm?

A To solve NP-Complete problems
B To make locally optimal choices
C To find optimal solutions
D To find exact solutions

Which of the following is used for finding the shortest path in a weighted graph?

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

What is the space complexity of the Merge Sort algorithm?

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

What is the worst-case time complexity of Quick Sort?

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

What is a key feature of dynamic programming?

A Always uses brute force
B Recursively solves overlapping subproblems
C Focuses on greedy choices
D Solves problems in one step

What does the “Theta” notation describe?

A Worst-case scenario
B Upper bound
C Exact asymptotic behavior
D Lower bound

What is the main goal of backtracking algorithms?

A To explore all potential solutions
B To find the best solution
C To find a random solution
D To minimize space complexity

What is the worst-case time complexity of Binary Search?

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

Which algorithm is used for pattern matching in strings?

A Merge Sort
B Quick Sort
C KMP
D Dijkstra’s

What is the primary feature of a hashing algorithm?

A To analyze patterns
B To map data to fixed-size values
C To find duplicates
D To sort data

Which of these is an example of a NP-Complete problem?

A Binary Search
B Sorting
C Traveling Salesman Problem
D Finding the shortest path

What is the main principle behind Divide and Conquer algorithms?

A Break a problem into smaller parts and solve recursively
B Optimize by selecting the best option
C Solve the problem without recursion
D Always find the minimum solution

Which algorithm is used to solve the Longest Common Subsequence problem?

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