retagged by
5,424 views
25 votes
25 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}$
retagged by

2 Answers

Best answer
24 votes
24 votes

Answer is $C$.

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

edited by
0 votes
0 votes
DFS is done using the stack data structure

 

BFS is done using the queue data structure

 

Sorting is done using heap in heap sort

 

X→ 3,Y→ 2 and Z→ 1

 

Corrcet answer will be option C.
Answer:

Related questions

52 votes
52 votes
3 answers
1
Kathleen asked Sep 14, 2014
11,745 views
The most appropriate matching for the following pairs$$\begin{array}{|ll|ll|}\hline X: & \text{m = malloc(5); m = NULL;} & 1: & \text{using dangling pointers} \\\hline Y...
22 votes
22 votes
2 answers
3