Use app×
Join Bloom Tuition
One on One Online Tuition
JEE MAIN 2025 Foundation Course
NEET 2025 Foundation Course
CLASS 12 FOUNDATION COURSE
CLASS 10 FOUNDATION COURSE
CLASS 9 FOUNDATION COURSE
CLASS 8 FOUNDATION COURSE
0 votes
2.6k views
in Information Technology by (120k points)
closed by
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 12

1 Answer

0 votes
by (121k points)
selected by
 
Best 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

 7          11     14     6     9     4     3     12   

           i                                                          j

 7     11     14     6     9     4     3     12   

          i                                       j

 7     3     14     6     9     4     11     12   

                 i                     j

 7     3     4     6     9     14     11     12   

                      i      j

 7     3     4     6     9     14     11     12   

                      j      i

 6      3      4      7      9      14      11      12

Welcome to Sarthaks eConnect: A unique platform where students can interact with teachers/experts/students to get solutions to their queries. Students (upto class 10+2) preparing for All Government Exams, CBSE Board Exam, ICSE Board Exam, State Board Exam, JEE (Mains+Advance) and NEET can ask questions from any subject and get quick answers by subject teachers/ experts/mentors/students.

Categories

...