Frequently Tested Exam Questions With
Verified Multiple Choice and Conceptual
Actual 100% Correct Detailed Answers
Guaranteed Pass!!Current Update!!
1. A greedy algorithm works by:
A. Trying all possible solutions and selecting the best
B. Making the locally optimal choice at each stage
C. Storing solutions to subproblems to reuse later
D. Splitting a problem into equal halves
Answer: B
2. Which algorithm paradigm solves problems by continuously dividing them into
smaller subproblems?
A. Greedy
B. Divide and conquer
C. Dynamic programming
D. Brute force
Answer: B
3. A recursive algorithm requires:
A. Minimizing the number of comparisons
B. Storing all subproblem results
C. A function that calls itself and a base case
,D. Choosing a global optimum at each step
Answer: C
4. Dynamic programming optimizes performance by:
A. Randomly selecting a pivot
B. Splitting the array in half repeatedly
C. Avoiding repeated computation through memoization
D. Replacing recursion with iteration
Answer: C
5. Which is an example of a divide-and-conquer algorithm?
A. Dijkstra’s algorithm
B. Merge sort
C. Prim’s algorithm
D. Bucket sort
Answer: B
6. Selection sort is characterized by:
A. Being stable and using extra memory
B. Choosing the smallest element and swapping it forward
C. Using a pivot to partition the array
D. Using a heap to speed up selection
Answer: B
7. Which sort is stable and works in place while scanning and inserting items into a
sorted portion of the list?
A. Merge sort
B. Quick sort
,C. Insertion sort
D. Selection sort
Answer: C
8. Shell sort speeds up insertion sort mainly by:
A. Reducing memory usage
B. Sorting distant elements first
C. Randomizing pivot selection
D. Using a heap structure
Answer: B
9. Quick sort generally runs in:
A. O(N²) worst case only
B. O(N) average time
C. O(N log N) on average
D. O(log N) on all inputs
Answer: C
10. In quicksort’s partitioning step, values less than the pivot are placed:
A. Randomly in the list
B. To its right
C. To its left
D. In the middle
Answer: C
11. 3-way quicksort is especially efficient when:
A. All keys are unique
B. Keys contain many duplicates
, C. The pivot is always the first element
D. Memory is unlimited
Answer: B
12. Merge sort’s main disadvantage is:
A. It is not stable
B. It requires extra memory proportional to N
C. It has O(N²) complexity
D. Pivot selection is difficult
Answer: B
13. Heap sort is similar to selection sort because it:
A. Uses recursion
B. Uses a heap to find the smallest or largest element efficiently
C. Creates multiple sublists
D. Is stable by design
Answer: B
14. The time complexity of heap sort is:
A. O(N²)
B. O(N log N)
C. O(log N)
D. O(N)
Answer: B
15. Which sorting algorithm is not done in place?
A. Quick sort
B. Shell sort