Algorithms MCQs (Set-2)

What is divide and conquer?

A Split, solve, combine
B Guess and verify
C Sort, hash, delete
D Queue, dequeue, restart

How does merge sort use divide and conquer?

A Pick pivots and partition
B Scan once and stop
C Use a hash table
D Sort halves then merge

What is a recurrence relation used to describe?

A Input encoding only
B Recursive running time
C Memory address arithmetic
D Compiler warning count

What does a recursion tree show?

A Cost across recursive calls
B Tree memory addresses only
C Sorted output values
D Hash collisions

What is the purpose of a base case?

A Choose a random pivot
B Handle smallest subproblem
C Merge final arrays
D Update a hash bucket

What is tail recursion?

A Function calls itself twice
B Recursion uses a queue
C Every call returns an array
D Recursive call is final operation

What is memoization?

A Cache results of subproblems
B Sort results after recursion
C Discard repeated inputs
D Convert recursion to a graph

What property supports dynamic programming?

A Unsorted input only
B Overlapping subproblems
C Distinct subproblems always
D Constant output size

What is optimal substructure?

A Optimal solution uses optimal subsolutions
B Every local choice is optimal
C Subproblems never overlap
D Output values are sorted

What does tabulation usually mean?

A Top down recursion only
B Randomized pivoting
C Bottom up dynamic programming
D Hash table resizing

What does a greedy algorithm choose?

A Every possible answer
B Locally best available option
C A random state always
D The last input item

Does a greedy local choice always yield a global optimum?

A No, only with suitable properties
B Yes for every problem
C Only for recursive inputs
D Yes when data is sorted

For activity selection, a common greedy rule chooses?

A Earliest finishing activity
B Longest duration first
C Latest starting activity
D Largest identifier first

Which knapsack variant suits value weight ratio greedy choice?

A 0/1 knapsack
B Bounded graph coloring
C Fractional knapsack
D Subset sum always

Why does ratio greedy fail in general for 0/1 knapsack?

A Items cannot be split
B Weights are always equal
C Values must be negative
D Capacity is unbounded

What does backtracking do after a choice fails?

A Keep every failed choice
B Sort the input again
C Hash the full search tree
D Undo choice and try another

What is pruning in search?

A Add more candidate branches
B Sort all partial answers
C Store every input copy
D Skip branches unable to help

What is exhaustive search?

A Use only a local choice
B Stop after first input
C Cache one subproblem
D Try every candidate solution

What is a randomized algorithm?

A Always produces random output
B Has no correctness guarantee
C Uses random choices during execution
D Runs only on random input

What distinguishes a Las Vegas algorithm?

A Approximate result, fixed runtime
B Correct result, random runtime
C Incorrect result, fixed memory
D Sorted result, random input

What distinguishes a Monte Carlo algorithm?

A Always correct with random runtime
B No random choices
C Bounded runtime, error probability
D Exact result in one step

What does amortized analysis average across?

A Random input values
B All possible algorithms
C A sequence of operations
D Every machine instruction globally

What is a heuristic?

A Proof of optimality always
B A sorted data structure
C Rule for a good solution
D A recurrence base case

What is the main goal of branch and bound?

A Sort graph edges
B Build a balanced tree
C Hash each candidate
D Prune suboptimal search branches

Why can memoization reduce runtime?

A It sorts inputs automatically
B It avoids repeated computation
C It removes every recursive call
D It lowers all memory use