1What does an internal node represent in a comparison tree?
Comparison tree
Easy
A.A completed output of the algorithm
B.A comparison between two elements
C.A randomly selected input value
D.A memory location used by the algorithm
Correct Answer: A comparison between two elements
Explanation:
Each internal node represents a comparison performed by the algorithm.
Incorrect! Try again.
2What does a leaf represent in a comparison tree for sorting?
Comparison tree
Easy
A.A comparison still to be performed
B.A temporary storage location
C.A possible final ordering
D.A single input element
Correct Answer: A possible final ordering
Explanation:
A leaf represents an outcome, such as one possible sorted ordering of the input.
Incorrect! Try again.
3How many branches usually leave a node representing a binary comparison?
Comparison tree
Easy
A.One branch
B.Four branches
C.Three branches
D.Two branches
Correct Answer: Two branches
Explanation:
A binary comparison has two possible outcomes, so its node has two outgoing branches.
Incorrect! Try again.
4What does the height of a comparison tree measure in worst-case analysis?
Comparison tree
Easy
A.The maximum number of comparisons
B.The number of possible algorithms
C.The amount of auxiliary memory
D.The number of input elements
Correct Answer: The maximum number of comparisons
Explanation:
The longest root-to-leaf path gives the maximum number of comparisons made on any input.
Incorrect! Try again.
5For sorting distinct elements, how many possible input orderings must a comparison tree distinguish?
Comparison tree
Easy
A.
B.
C.
D.
Correct Answer:
Explanation:
There are permutations of distinct elements, and sorting must distinguish among them.
Incorrect! Try again.
6What lower bound does the comparison-tree model establish for comparison-based sorting?
Comparison tree
Easy
A.
B.
C.
D.
Correct Answer:
Explanation:
Any comparison-based sorting algorithm requires comparisons in the worst case.
Incorrect! Try again.
7Which algorithm is naturally analyzed using a comparison tree?
Comparison tree
Easy
A.Comparison-based sorting
B.String concatenation
C.Matrix initialization
D.Direct table lookup
Correct Answer: Comparison-based sorting
Explanation:
Comparison trees model algorithms whose decisions depend on comparisons between input elements.
Incorrect! Try again.
8In algorithm analysis, what is an oracle?
Oracles
Easy
A.A tree that sorts all elements
B.A compiler that optimizes programs
C.A black box that answers queries
D.A device that stores every input
Correct Answer: A black box that answers queries
Explanation:
An oracle is an abstract black box that provides answers when an algorithm submits queries.
Incorrect! Try again.
9How does an algorithm obtain information from an oracle?
Oracles
Easy
A.By changing its internal state
B.By sorting the oracle
C.By submitting a query
D.By copying its source code
Correct Answer: By submitting a query
Explanation:
The algorithm communicates with an oracle through queries and receives answers.
Incorrect! Try again.
10In an oracle model, what resource is commonly counted to prove a lower bound?
Oracles
Easy
A.The number of comments
B.The number of variables
C.The number of functions
D.The number of queries
Correct Answer: The number of queries
Explanation:
Oracle lower bounds commonly measure how many queries are necessary to solve a problem.
Incorrect! Try again.
11Why are oracles useful in lower-bound theory?
Oracles
Easy
A.They remove the need for input
B.They model limited information access
C.They guarantee constant running time
D.They convert every problem into sorting
Correct Answer: They model limited information access
Explanation:
Oracles help analyze how much information an algorithm must request before finding a solution.
Incorrect! Try again.
12What is hidden from an algorithm interacting with a black-box oracle?
Oracles
Easy
A.The oracle's internal implementation
B.The allowed query format
C.The returned query answers
D.The algorithm's own computation
Correct Answer: The oracle's internal implementation
Explanation:
The algorithm can observe answers but does not directly access the oracle's internal implementation.
Incorrect! Try again.
13If each oracle query has two possible answers, what can one query provide at most?
Oracles
Easy
A.Two bytes of information
B.One bit of information
C. bits of information
D. bytes of information
Correct Answer: One bit of information
Explanation:
Choosing between two possible answers provides at most one bit of information.
Incorrect! Try again.
14Which statement best describes an oracle-based lower bound?
Oracles
Easy
A.It limits the program's source length
B.It proves a minimum query count
C.It proves a maximum input size
D.It limits the available memory size
Correct Answer: It proves a minimum query count
Explanation:
An oracle-based lower bound shows that every algorithm needs at least a certain number of queries.
Incorrect! Try again.
15What is the main purpose of an adversary argument?
Adversary arguments
Easy
A.To design the shortest source code
B.To reduce the input size
C.To select random test data
D.To prove a lower bound
Correct Answer: To prove a lower bound
Explanation:
An adversary argument demonstrates that an algorithm must perform a minimum amount of work.
Incorrect! Try again.
16How does an adversary typically answer an algorithm's queries?
Adversary arguments
Easy
A.To preserve many possible inputs
B.To end the computation immediately
C.To select the smallest input
D.To reveal all information immediately
Correct Answer: To preserve many possible inputs
Explanation:
The adversary gives consistent answers that keep as many input possibilities unresolved as possible.
Incorrect! Try again.
17What must be true of the answers supplied by a valid adversary?
Adversary arguments
Easy
A.They must reveal the complete input
B.They must always be random
C.They must always favor the algorithm
D.They must remain mutually consistent
Correct Answer: They must remain mutually consistent
Explanation:
Adversary answers must be compatible with at least one valid input throughout the interaction.
Incorrect! Try again.
18In an adversary argument, when can an algorithm safely stop?
Adversary arguments
Easy
A.When every element has been modified
B.When it has made one query
C.When the answer is uniquely determined
D.When the adversary changes the rules
Correct Answer: When the answer is uniquely determined
Explanation:
The algorithm can stop only when the information obtained determines a correct answer.
Incorrect! Try again.
19An adversary argument usually focuses on which type of algorithm behavior?
Adversary arguments
Easy
A.Worst-case behavior
B.Best-case behavior
C.Average-case behavior
D.Undefined behavior
Correct Answer: Worst-case behavior
Explanation:
The adversary forces the algorithm into a difficult sequence of decisions, establishing a worst-case bound.
Incorrect! Try again.
20In the problem of finding the maximum among elements, what does each non-maximum element need to experience?
Adversary arguments
Easy
A.At least one comparison loss
B.At least one comparison win
C.Exactly two comparison wins
D.Exactly two comparison losses
Correct Answer: At least one comparison loss
Explanation:
Every element except the maximum must lose a comparison, which leads to the lower bound of comparisons.
Incorrect! Try again.
21A comparison-based sorting algorithm is applied to 5 distinct elements. What minimum worst-case number of comparisons follows from the comparison-tree leaf-count argument?
Comparison tree
Medium
A. comparisons
B. comparisons
C. comparisons
D. comparisons
Correct Answer: comparisons
Explanation:
The tree needs at least leaves. Therefore, its height is at least .
Incorrect! Try again.
22A binary comparison tree has height 12. What is the largest number of distinct input cases it can distinguish?
Comparison tree
Medium
A. cases
B. cases
C. cases
D. cases
Correct Answer: cases
Explanation:
A binary tree of height has at most leaves. For , this is .
Incorrect! Try again.
23After several comparisons, the resulting partial order is consistent with different total orders. What information-theoretic lower bound applies to the number of additional binary comparisons required?
Comparison tree
Medium
A.
B.
C.
D.
Correct Answer:
Explanation:
The remaining subtree must distinguish among possibilities, so it needs height at least .
Incorrect! Try again.
24Using only the leaf-count argument, what lower bound is obtained for sorting 6 distinct elements?
Comparison tree
Medium
A. comparisons
B. comparisons
C. comparisons
D. comparisons
Correct Answer: comparisons
Explanation:
There are permutations. Since , at least comparisons are required.
Incorrect! Try again.
25Two sorted lists contain 3 and 5 distinct elements. Their merged order can correspond to any interleaving that preserves each list's internal order. What lower bound follows from counting these interleavings?
Comparison tree
Medium
A. comparisons
B. comparisons
C. comparisons
D. comparisons
Correct Answer: comparisons
Explanation:
There are possible interleavings, giving the lower bound .
Incorrect! Try again.
26A comparison-based algorithm must identify the largest among 32 distinct elements. Which lower bound applies to its worst-case number of comparisons?
Comparison tree
Medium
A. comparisons
B. comparisons
C. comparisons
D. comparisons
Correct Answer: comparisons
Explanation:
Every nonmaximum element must lose at least one comparison. Eliminating 31 candidates requires at least comparisons.
Incorrect! Try again.
27Under a uniform distribution over all input permutations, which expression is an information-theoretic lower bound on the average number of comparisons needed for sorting?
Comparison tree
Medium
A.
B.
C.
D.
Correct Answer:
Explanation:
A binary comparison tree distinguishing equally likely permutations has average leaf depth at least .
Incorrect! Try again.
28A hidden object is one of 100 possibilities, and every oracle query returns one bit. What is the minimum number of queries required in the worst case?
Oracles
Medium
A. queries
B. queries
C. queries
D. queries
Correct Answer: queries
Explanation:
With binary answers, at most possibilities can be distinguished. Since , at least 7 queries are needed.
Incorrect! Try again.
29An oracle reveals any requested bit of an unknown -bit string. How many queries are required in the worst case to compute the parity of the entire string exactly?
Oracles
Medium
A.
B.
C.
D.
Correct Answer:
Explanation:
If any bit is unqueried, changing only that bit changes the parity without changing the observed answers. Thus every bit must be queried.
Incorrect! Try again.
30Exactly one of positions is marked. A query asks whether a chosen position is marked. What is the deterministic worst-case number of queries needed to identify the marked position?
Oracles
Medium
A.
B.
C.
D.
Correct Answer:
Explanation:
After negative answers, the final unqueried position must be marked. An adversary can force this situation.
Incorrect! Try again.
31An unsorted array has positions and may contain no marked position. A query tests one chosen position. How many deterministic queries are necessary in the worst case to decide whether a mark exists?
Oracles
Medium
A.
B.
C.
D.
Correct Answer:
Explanation:
If even one position remains unqueried, it might contain a mark. The all-negative instance therefore requires querying all positions.
Incorrect! Try again.
32Exactly one of 64 items is defective. An oracle accepts any subset and reports whether that subset contains the defective item. What is the optimal worst-case number of queries?
Oracles
Medium
A. queries
B. queries
C. queries
D. queries
Correct Answer: queries
Explanation:
Six binary answers can distinguish possibilities, and repeatedly testing half of the remaining items achieves this bound.
Incorrect! Try again.
33A value oracle returns the exact value stored at a requested array index. The values are arbitrary and unrelated. How many value queries are necessary to find the minimum in the worst case?
Oracles
Medium
A.
B.
C.
D.
Correct Answer:
Explanation:
An unqueried position could contain a value smaller than every observed value, so all positions must be queried.
Incorrect! Try again.
34An algorithm makes oracle calls, and each oracle call can be simulated using at most comparisons. What comparison upper bound does the simulation provide?
Oracles
Medium
A. comparisons
B. comparisons
C. comparisons
D. comparisons
Correct Answer: comparisons
Explanation:
Replacing each of the oracle calls with a simulation using at most comparisons gives at most comparisons.
Incorrect! Try again.
35In a lower-bound proof for finding the maximum, an adversary declares one compared element smaller while keeping the other as a possible maximum. How many candidates can one comparison eliminate?
Adversary arguments
Medium
A.Exactly one candidate
B.Exactly two candidates
C.All but one candidate
D.At most half the candidates
Correct Answer: Exactly one candidate
Explanation:
Only the element that loses the comparison is certified not to be the maximum, so one candidate is eliminated.
Incorrect! Try again.
36For even , what worst-case comparison lower bound can an adversary establish for finding both the minimum and maximum?
Adversary arguments
Medium
A.
B.
C.
D.
Correct Answer:
Explanation:
Pairing elements first and then maintaining separate minimum and maximum candidates yields the lower bound .
Incorrect! Try again.
37For 16 distinct elements, what lower bound does the tournament adversary give for finding the second-largest element?
Adversary arguments
Medium
A. comparisons
B. comparisons
C. comparisons
D. comparisons
Correct Answer: comparisons
Explanation:
Finding the maximum needs 15 comparisons. It defeats 4 elements, and finding the largest of those requires 3 more, totaling 18.
Incorrect! Try again.
38To prove a lower bound for unsuccessful search in an unsorted array, an adversary answers "not present here" whenever a new position is queried. Why can it continue doing so through all positions?
Adversary arguments
Medium
A.The absent instance remains consistent
B.The array is assumed to be sorted
C.The algorithm repeats every query
D.The oracle can change past answers
Correct Answer: The absent instance remains consistent
Explanation:
All negative answers remain consistent with an input containing no target, so the algorithm cannot conclude absence before checking every position.
Incorrect! Try again.
39In a comparison-sorting adversary proof, what strategy most directly supports the lower bound?
Adversary arguments
Medium
A.Preserve many consistent permutations
B.Force comparisons in index order
C.Reveal the final order immediately
D.Return equality for every comparison
Correct Answer: Preserve many consistent permutations
Explanation:
The adversary chooses consistent answers that leave many possible permutations, forcing the algorithm to gather enough information to isolate one order.
Incorrect! Try again.
40An adversary has maintained a set of inputs consistent with every answer so far. What condition must hold whenever it gives the next answer?
Adversary arguments
Medium
A.The answer changes an earlier response
B.The updated set remains nonempty
C.The answer matches every possible input
D.The updated set has one input
Correct Answer: The updated set remains nonempty
Explanation:
An adversary answer is valid only if at least one actual input remains consistent with the complete transcript.
Incorrect! Try again.
41A deterministic comparison sort operates on distinct keys. What is the tightest integer lower bound obtained solely by counting leaves in its binary comparison tree?
Comparison tree
Hard
A.
B.
C.
D.
Correct Answer:
Explanation:
Each of the input permutations must reach a distinct leaf. A binary tree with leaves has height at least .
Incorrect! Try again.
42There are labeled records whose ordered key values have known multiplicities , where . If each comparison has outcomes less than, equal to, or greater than, what information-theoretic height bound follows for determining the complete weak order?
Comparison tree
Hard
A.
B.
C.
D.
Correct Answer:
Explanation:
There are distinguishable assignments of records to ordered key groups. A ternary comparison tree with that many leaves requires the stated height.
Incorrect! Try again.
43For distinct elements, what is the exact worst-case number of comparisons needed to find both the largest and the second-largest elements?
Comparison tree
Hard
A.
B.
C.
D.
Correct Answer:
Explanation:
A tournament finds the maximum using comparisons. The second-largest is the largest among the elements that lost directly to the maximum, requiring more.
Incorrect! Try again.
44When is odd, what is the optimal worst-case number of comparisons required to find both the minimum and maximum of distinct elements?
Comparison tree
Hard
A.
B.
C.
D.
Correct Answer:
Explanation:
Pairing elements lets one comparison classify each pair, followed by separate minimum and maximum tournaments. The matching lower bound gives comparisons.
Incorrect! Try again.
45A comparator can return less than, equal to, or greater than. Why does sorting distinct keys still have the leaf-counting lower bound rather than ?
Comparison tree
Hard
A.The strict-order branches always have equal depth
B.The equality branch is unreachable on valid inputs
C.The equality branch duplicates a strict-order leaf
D.The comparator must encode outcomes using two bits
Correct Answer: The equality branch is unreachable on valid inputs
Explanation:
Because all keys are distinct, no comparison can return equality. Each reachable internal node therefore has at most two children, so the effective decision tree is binary.
Incorrect! Try again.
46Two sorted sequences have lengths and , and all keys are distinct. What is the strongest direct lower bound obtained by counting all possible interleavings in a binary comparison tree?
Comparison tree
Hard
A.
B.
C.
D.
Correct Answer:
Explanation:
The merged order can be any of interleavings preserving each input's internal order. Distinguishing them requires at least the logarithm of that number.
Incorrect! Try again.
47A randomized comparison sort is correct on every input. If input permutations are uniformly distributed, which lower bound applies to its expected number of comparisons, averaged over both inputs and internal randomness?
Comparison tree
Hard
A.At least
B.At least
C.At least
D.At least
Correct Answer: At least
Explanation:
Every fixed deterministic tree in the algorithm's random mixture has average depth at least under the uniform distribution. Averaging over the mixture preserves this bound.
Incorrect! Try again.
48Suppose permutation occurs with probability . For any correct binary comparison tree, which quantity lower-bounds the expected number of comparisons?
Comparison tree
Hard
A.
B.
C.
D.
Correct Answer:
Explanation:
Root-to-leaf paths form a binary prefix code for the permutations. The expected code length is at least the Shannon entropy .
Incorrect! Try again.
49A Boolean oracle hides a string promised to be either all zeros or to contain exactly one . How many queries are necessary in the deterministic worst case to decide which case holds?
Oracles
Hard
A.
B.
C.
D.
Correct Answer:
Explanation:
After any zero answers, both an all-zero string and a string whose only is at the unqueried position remain consistent.
Incorrect! Try again.
50For the same promise problem—an all-zero string versus exactly one —what is the bounded-error randomized query complexity when every valid input must be answered correctly with probability at least ?
Oracles
Hard
A.
B.
C.
D.
Correct Answer:
Explanation:
To detect a at every possible position with constant probability, a classical randomized algorithm must query a constant fraction of all positions. Querying all positions gives the matching upper bound.
Incorrect! Try again.
51An oracle exposes individual bits of an unknown string . What is the deterministic query complexity of computing the parity ?
Oracles
Hard
A.
B.
C.
D.
Correct Answer:
Explanation:
If any bit is unqueried, flipping only that bit preserves the transcript but reverses parity. Thus every bit must be queried in the worst case.
Incorrect! Try again.
52Problem has a lower bound of queries in oracle model . Every query to oracle can be simulated using at most queries to oracle . What lower bound follows for solving in model ?
Oracles
Hard
A. queries
B. queries
C. queries
D. queries
Correct Answer: queries
Explanation:
An algorithm using queries to would yield a -oracle algorithm using at most queries. Since , it follows that .
Incorrect! Try again.
53For the Boolean OR function, a -input can have a one-bit certificate, while the all-zero input needs an -bit certificate. What deterministic worst-case oracle-query lower bound follows?
Oracles
Hard
A.
B.
C.
D.
Correct Answer:
Explanation:
Certifying that OR is zero requires verifying every input bit. Therefore the maximum certificate complexity, and hence deterministic query complexity, is .
Incorrect! Try again.
54An oracle query has at most possible answers, and every valid hidden object among candidates must be uniquely identified. What general deterministic query lower bound follows?
Oracles
Hard
A.
B.
C.
D.
Correct Answer:
Explanation:
A depth- query tree has at most transcripts. Unique identification requires , giving .
Incorrect! Try again.
55In an adversary proof for finding the maximum, each element initially forms a separate candidate component. A comparison eliminates at most one candidate for maximum. What lower bound results?
Adversary arguments
Hard
A. comparisons
B. comparisons
C. comparisons
D. comparisons
Correct Answer: comparisons
Explanation:
Initially all elements may be the maximum. Each comparison gives one element a loss and eliminates at most that one candidate, so eliminating candidates requires comparisons.
Incorrect! Try again.
56For simultaneously finding the minimum and maximum, an adversary initially labels every element as eligible for both roles. Which worst-case lower bound can be forced by making comparisons between two unclassified elements remove only one minimum candidate and one maximum candidate?
Adversary arguments
Hard
A.
B.
C.
D.
Correct Answer:
Explanation:
The first comparison involving a pair can eliminate one minimum and one maximum candidate, while later eliminations generally cost separately. This yields the tight bound .
Incorrect! Try again.
57A target is promised not to equal any of the keys in a sorted array. An adversary keeps every feasible insertion gap consistent with the answers. What comparison lower bound follows?
Adversary arguments
Hard
A.
B.
C.
D.
Correct Answer:
Explanation:
There are possible insertion gaps. Equality is excluded, so each comparison has only two feasible outcomes and can distinguish at most two sets of gaps.
Incorrect! Try again.
58In finding the largest and second-largest among arbitrary distinct elements, a weighted adversary ensures that the final maximum has defeated at least elements directly. What total lower bound does this establish?
Adversary arguments
Hard
A.
B.
C.
D.
Correct Answer:
Explanation:
Finding the maximum costs at least comparisons. The direct losers are the only second-largest candidates and require at least additional comparisons.
Incorrect! Try again.
59Why can an adversary prove an comparison lower bound for deciding whether real numbers are all distinct, despite the problem having only two possible outputs?
Adversary arguments
Hard
A.Each output requires exactly half of all permutations
B.Each rejecting leaf must identify every duplicate pair
C.Each accepting leaf must imply one total ordering
D.Each comparison must inspect two independent permutations
Correct Answer: Each accepting leaf must imply one total ordering
Explanation:
If an accepting leaf leaves two adjacent elements unordered, they can be made equal without contradicting its comparisons. Thus an all-distinct leaf must determine a total order, requiring at least accepting regions.
Incorrect! Try again.
60Two nonempty sorted lists of lengths and must be merged. An adversary answers cross-list comparisons so that neither list can be certified exhausted prematurely. What exact worst-case lower bound can it force?
Adversary arguments
Hard
A.
B.
C.
D.
Correct Answer:
Explanation:
The adversary can keep the next element of either list feasible until only one output element remains. Hence every earlier output position requires a comparison, totaling .
Incorrect! Try again.
Did this save you a night before the exam?
LPU Notes is free, and it stays free. Ads cover part of the server bill.
The rest comes out of a student's own pocket: the domain, the storage,
and keeping the site up through the weeks everyone needs it at once.
The payment button didn't load. An ad blocker or a filtered network is the usual reason.
to try again.
Nothing here is ever locked, and nothing unlocks. Chip in only if it was worth it.
What it pays for →