1.

Apply Quick sort on a given sequence 7 11 14 6 9 4 3 12. What is the sequence after first phase, pivot is first element?(a) 6 4 3 7 11 9 14 12(b) 6 3 4 7 9 14 11 12(c) 7 6 14 11 9 4 3 12(d) 7 6 4 3 9 14 11 12This question was addressed to me in semester exam.The above asked question is from Quicksort topic in chapter Sorting of Data Structures & Algorithms II

Answer»

The correct ANSWER is (B) 6 3 4 7 9 14 11 12

To explain: Let’s apply Quick SORT on the given sequence,

For first phase, PIVOT = 7

 71114694312

ij

 71114694312

ij

 73146941112

ij

 73469141112

ij

 73469141112

ji

 63479141112



Discussion

No Comment Found

Related InterviewSolutions