1k views

The most appropriate matching for the following pairs

    X: depth first search         1: heap
Z: sorting                    3: stack

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}$
edited | 1k views

Answer is $C$.

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

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