in Algorithms edited by
3,044 views
21 votes

The most appropriate matching for the following pairs

$$\begin{array}{|l|l|}\hline \text{X: depth first search}  &  \text{1: heap } \\\hline  \text{Y: breadth first search} & \text{2: queue} \\\hline  \text{Z: sorting} & \text{3: stack} \\\hline \end{array}$$

is:

  1. $\text{X - 1,  Y - 2,  Z - 3}$
  2. $\text{X - 3,  Y - 1,  Z - 2}$
  3. $\text{X - 3,  Y - 2,  Z - 1}$
  4. $\text{X - 2,  Y - 3,  Z - 1}$
in Algorithms edited by
3k views

1 Answer

20 votes
 
Best answer

Answer is $C$.

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

edited by

2 Comments

What do you mean by the words "EXPLICIT" and "IMPLICIT" here?
1
DFS algorithm directly does not use any stack but since it calls itself(recursion), recursion stack will be  used by the OS
7
Answer:

Related questions