Question

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

Option 1 : Insertion sort / निवेशन सॉर्ट

Advertisement

Detailed Solution

सही उत्तर Insertion sort / निवेशन सॉर्ट है।

Key Points
Helpful?
PrepSnapprepsnap.in • Part -A

Question:

An array of one million records is already nearly sorted, and a stable sort is required. The best choice is / दस लाख रिकॉर्डों का ऐरे पहले से लगभग क्रमबद्ध है, और स्थिर सॉर्ट आवश्यक है। सर्वोत्तम चयन है

1.
Insertion sort / निवेशन सॉर्ट
2.
Selection sort / चयन सॉर्ट
3.
Quicksort with first-element pivot / प्रथम-अवयव धुरी वाला क्विकसॉर्ट
4.
Heap sort / हीप सॉर्ट

Correct Answer: Insertion sort / निवेशन सॉर्ट

Insertion sort runs in O(n) on nearly-sorted data and is stable; quicksort degrades toward O(n²) on sorted input, while selection and heap sort are not stable and always cost O(n log n) or O(n²). / निवेशन सॉर्ट लगभग-क्रमबद्ध डेटा पर O(n) में चलता है और स्थिर है; क्विकसॉर्ट क्रमबद्ध इनपुट पर O(n²) की ओर बिगड़ता है, जबकि चयन और हीप सॉर्ट स्थिर नहीं हैं और सदा O(n log n) या O(n²) लेते हैं।

Downloaded from PrepSnap (prepsnap.in)