Match the LIST-I with LIST-II Choose the correct answer from the options given below:LIST-I LIST-II A. Breadth First Search I. LISP B. Depth First Search II. Syntax tree C. Prefix III. Stack D. Infix IV. Queue
A-IV, B-III, C-I, D-II
Each LIST-I item is associated with the structure or language that typically implements or uses it (Cormen; Aho, Sethi and Ullman).
A. Breadth First Search visits vertices level by level in first-in-first-out order, so it is implemented with a Queue → IV.
B. Depth First Search goes as deep as possible and backtracks in last-in-first-out order, so it uses a Stack (explicitly or through recursion) → III.
C. Prefix (Polish) notation places the operator before its operands, exactly as LISP writes expressions, e.g. (+ 2 3) → I.
D. Infix notation is what an in-order traversal of a Syntax tree (expression tree) produces, with the operator between its operands → II.
A-III, B-IV, C-I, D-II and A-III, B-IV, C-II, D-I both give BFS a stack and DFS a queue, the reverse of their FIFO/LIFO behaviour; A-IV, B-II, C-III, D-I links DFS to a syntax tree and prefix to a stack.
A-IV, B-III, C-I, D-II option is correct.