+1 vote
in Data Structures & Algorithms II by (110k points)
The given array is arr = {2,6,1}. What are the pivots that are returned as a result of subsequent partitioning?

(a) 1 and 6

(b) 6 and 1

(c) 2 and 6

(d) 1

I got this question in an internship interview.

The origin of the question is Quicksort topic in division Sorting of Data Structures & Algorithms II

1 Answer

+1 vote
by (614k points)
selected by
Best answer
Correct answer is (d) 1

Easiest explanation - There is only one pivot with which the array will be sorted, the pivot is 1.

Related questions

Welcome to TalkJarvis QnA, a question-answer community website for the people by the people. On TalkJarvis QnA you can ask your doubts, curiosity, questions and whatever going in your mind either related to studies or others. Experts and people from different fields will answer.