Sorting Algorithms
Some Terms In-place Sorting => use constant space to sort (modify only the given array) Stable sorting - When two same values appear in the same relative order in sorted data as in the original array => Eg: Merge Sort, Insertion Sort, Bubble Sort ₪ When equal elements are indistinguishable like integers => stability is not an issue. → ----> If stable sorting is used => get shown pic ₪ If we sort section-wise & sorting algorithm is unstable => may get random ordering ₪ Any given sorting algorithm which is unstable can be modified to be stable Augment index along with value → If values are same → use index as tiebreaker → Drawback - extra O(N) space to store index for N element + need extra comparison Counting sort is unstable but can be made stable - 1 6a 8 3 6b 0 6c 4 ---> a, b, c is used just to distinguish ordering of same value Stable Algo - 0 1 3 4 6a 6b 6c 8 count arr...