The Gateway to Computer Science Excellence
First time here? Checkout the FAQ!
x
+13 votes
762 views

The most appropriate matching for the following pairs

    X: depth first search         1: heap 
    Y: breadth-first search       2: queue 
    Z: sorting                    3: stack

is:

  1. X - 1  Y - 2  Z - 3
  2. X - 3  Y - 1  Z - 2
  3. X - 3  Y - 2  Z - 1
  4. X - 2  Y - 3  Z - 1
asked in Algorithms by Veteran (68.8k points)
retagged by | 762 views

3 Answers

+15 votes
Best answer

Answer C:

X - 3 DFS uses stack implicitly
Y - 2 BFS uses queue explicitly in Algo
Z - 1 Heap-Heapsort
 

answered by Veteran (48.5k points)
edited by
+6 votes
Answer: C
answered by Veteran (35.8k points)
+1 vote
Ans: C
answered by Boss (7.3k points)
Answer:

Related questions



Quick search syntax
tags tag:apple
author user:martin
title title:apple
content content:apple
exclude -tag:apple
force match +apple
views views:100
score score:10
answers answers:2
is accepted isaccepted:true
is closed isclosed:true

32,330 questions
39,146 answers
108,247 comments
36,501 users