Question

1.
2.
3.
4.
Answer (Detailed Solution Below)

Option 4 : already sorted with the first element as pivot / पहले तत्व को पिवट मानकर पहले से क्रमबद्ध

Advertisement

Detailed Solution

सही उत्तर already sorted with the first element as pivot / पहले तत्व को पिवट मानकर पहले से क्रमबद्ध है।

Key Points
Helpful?
PrepSnapprepsnap.in • Part -A

Question:

Quick sort exhibits its O(n squared) worst case when the input array is / क्विक सॉर्ट अपनी O(n squared) सबसे खराब स्थिति तब दर्शाता है जब इनपुट ऐरे हो

1.
randomly shuffled with a random pivot / यादृच्छिक पिवट के साथ यादृच्छिक रूप से फेरबदल किया हुआ
2.
already sorted with the median-of-three pivot / मीडियन-ऑफ-थ्री पिवट के साथ पहले से क्रमबद्ध
3.
reverse sorted with the middle element as pivot / मध्य तत्व को पिवट मानकर उल्टे क्रम में क्रमबद्ध
4.
already sorted with the first element as pivot / पहले तत्व को पिवट मानकर पहले से क्रमबद्ध

Correct Answer: already sorted with the first element as pivot / पहले तत्व को पिवट मानकर पहले से क्रमबद्ध

With the first element as pivot on a sorted array, every partition is maximally unbalanced with one side empty, producing quadratic total work. / क्रमबद्ध ऐरे पर पहले तत्व को पिवट मानने से प्रत्येक विभाजन अधिकतम असंतुलित होता है जिसमें एक पक्ष रिक्त रहता है, जिससे कुल कार्य द्विघाती हो जाता है।

Downloaded from PrepSnap (prepsnap.in)