Question
Which of the following sorting algorithms is NOT
stable?ÂSolution
Quick Sort is not a stable sorting algorithm. Stability in sorting algorithms means that equal elements retain their relative order before and after sorting. Quick Sort does not guarantee this behavior because, during partitioning, equal elements may get swapped in such a way that their relative order is not preserved. Although Quick Sort is an efficient comparison-based sorting algorithm with an average time complexity of O(n log n), its lack of stability makes it unsuitable for cases where maintaining relative order of equivalent elements is crucial. Why Other Options are Incorrect: A) Merge Sort: This is a stable sorting algorithm as it ensures that the relative order of equal elements remains unchanged. B) Bubble Sort: Bubble Sort is stable as elements are swapped only if necessary. D) Insertion Sort: Insertion Sort is stable because it inserts equal elements in their original order. E) Tim Sort: Tim Sort is a stable sorting algorithm, combining Merge Sort and Insertion Sort properties.
In expression ‘G $ H & I @ J # K % L $ M & N’ who is the only daughter of I?
If the expression ‘U & Z # Y * W & V’ is true, then how is Z’s son related to father in law of only sister in law of Y?
How is H related to M?
- A@B means A is married to B. A#B means B is mother of A. A$B means B is son of A. A!B means B is brother of A. If Q @ P # R @ S # T @ U $ V ! W and gender ...
If A × B means that A is the brother of B, A – B means that A is the sister of B, A + B means that A is the father of B then which of the following e...
- If 'A@B' means 'A is father of B', 'A#B' means 'A is wife of B', 'A$B' means 'A is sister of B', 'A%B' means 'A is brother of B'. If 'L @ M $ N # P @ O % Q...
If "L $ M @ N & C % O # P & Q © R", then how is L related to P?Â
Statements : R < Q ≤ T > S = V, D < F ≤ Q
Conclusions : I. T > D II. F < R
If ‘P@Q’ means ‘P is the mother of Q’, ‘P$Q’ means ‘P is the husband of Q’, ‘P#Q’ means ‘P is the sister of Q’, ‘P*Q’ means...
If "J © K & L # F # G @ H & I % M $ N", then how is G related to K?Â