Algorithms and Complexity MCQs (Part-4)

Which of these algorithms uses the divide and conquer technique?

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

Which problem is solved using Dynamic Programming?

A Knapsack Problem
B Quick Sort
C Merge Sort
D Fibonacci Sequence

What is the space complexity of Merge Sort?

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

What does “Big O” notation describe?

A Average case
B Best-case complexity
C Worst-case complexity
D Space requirement

Which of the following is true about a greedy algorithm?

A Always finds optimal solution
B Uses dynamic programming
C Solves all problems optimally
D Makes locally optimal choices

What does the Bellman-Ford algorithm find?

A Shortest path with negative weights
B Maximum flow
C Minimum spanning tree
D All pairs shortest path

Which sorting algorithm has the worst-case time complexity of O(n log n)?

A Quick Sort
B Merge Sort
C Heap Sort
D Bubble Sort

What is the primary feature of dynamic programming?

A Greedy choice
B Sorting
C Recursion with overlapping subproblems
D Parallel computation

What does the Floyd-Warshall algorithm solve?

A Shortest path between two vertices
B Minimum spanning tree
C All-pairs shortest path
D Longest path

Which sorting algorithm is based on the divide and conquer paradigm?

A Insertion Sort
B Bubble Sort
C Quick Sort
D Selection Sort

Which algorithm is used for optimal substructure problems?

A Dynamic Programming
B Greedy Algorithm
C Divide and Conquer
D Brute Force

Which algorithm is used to solve the minimum spanning tree problem?

A Dijkstra’s Algorithm
B Bellman-Ford
C Floyd-Warshall
D Prim’s Algorithm

What is the time complexity of the Binary Search algorithm?

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

What is the purpose of the Rabin-Karp algorithm?

A Sorting strings
B Searching a string in a text
C Calculating hashes
D Finding maximum flow

Which algorithm is used for optimal substructure problems?

A Merge Sort
B Quick Sort
C Dijkstra’s Algorithm
D Insertion Sort