Question:
Which of the following sorting algorithms is NOT stable in its standard implementation?
निम्नलिखित में से कौन सा सॉर्टिंग एल्गोरिदम अपने मानक कार्यान्वयन में स्थिर (Stable) नहीं है?
Options:
- Heap Sort
- Merge Sort
- Insertion Sort
- Bubble Sort
- हीप सॉर्ट (Heap Sort)
- मर्ज सॉर्ट (Merge Sort)
- इंसर्शन सॉर्ट (Insertion Sort)
- बबल सॉर्ट (Bubble Sort)
Correct Answer: a)
Explanation:
A sorting algorithm is stable if equal elements retain their relative input order. Heap Sort, QuickSort, and Selection Sort are inherently unstable because heap swaps and pivot partitioning can alter the order of identical elements.
हीप सॉर्ट (Heap Sort) स्थिर (Stable) नहीं है क्योंकि हीप के पुनर्निर्माण (heapify) और स्वैपिंग के दौरान समान मान वाले तत्वों का मूल क्रम बदल जाता है।