Algorithms and Complexity MCQs (Part-1)

What does “Big O” notation represent in algorithm analysis?

A Space Complexity
B Worst‐Case Time Complexity
C Best‐Case Time Complexity
D Average Time Complexity

Which algorithm is used to find the shortest path in a graph with non-negative weights?

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

What does the term “NP-Complete” refer to?

A A solvable problem in polynomial time
B Problems that can be solved in exponential time
C Problems for which no polynomial-time solution is known
D Problems with unknown solutions

What is the main advantage of the divide and conquer approach?

A Solves subproblems independently
B Better space complexity
C Guarantees optimal solution
D Simple to implement

Which of the following is a feature of dynamic programming?

A Greedy approach
B Randomized solution
C Subproblem overlap
D No recursion

What is the time complexity of Binary Search on a sorted array?

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

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

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

What does the greedy algorithm approach ensure?

A Optimal solution for all problems
B The minimum space complexity
C Suboptimal solution with faster execution
D Always guarantees the best time complexity

Which algorithm is used to find the longest common subsequence (LCS)?

A Merge Sort
B Dynamic Programming
C Quick Sort
D Dijkstra’s Algorithm

What does the “Theta” notation describe in algorithm complexity?

A Upper Bound
B Lower Bound
C Exact Bound
D Worst Case

What is the primary advantage of Quick Sort over Merge Sort?

A Faster average time complexity
B Always stable
C Better for linked lists
D Requires extra space

In which case is a backtracking algorithm used?

A When the problem has a single solution
B When an exact solution is not necessary
C When a greedy algorithm is too slow
D When the problem has multiple valid solutions

Which of the following is true about NP-Hard problems?

A They can be solved in polynomial time
B They are at least as hard as NP-Complete problems
C They have an efficient approximation algorithm
D They can always be reduced to a simpler problem

What does the Floyd-Warshall algorithm solve?

A Shortest path in a weighted graph
B Longest path in an unweighted graph
C Minimum spanning tree
D All pairs shortest path

What does the term “NP” stand for in computational complexity theory?

A Non-deterministic Polynomial
B Not Polynomial
C Non-Polynomial
D Normal Polynomial