Vidyalelo
Data Structure · Q727

Miscellaneous on Data Structures

Programming · Data Structure · question 727

Q727

What is the name given to the algorithm depicted in the pseudo code below? procedure generate(n : integer, Arr : array): if n = 1 then output(Arr) else for i = 0; i <= n - 2; i ++ do generate(n - 1, Arr) if n is even then swap(Arr[i], Arr[n-1]) else swap(Arr[0], Arr[n-1]) end if end for generate(n - 1, Arr ) end if

A.
bubble sort
B.
heap sort
C.
heap's algorithm
Answer
D.
prim's algorithm

Answer: Option C

Solution

Answer: Option C
No explanation is given for this question Let's Discuss on Board