Sorting
Stable vs In-Place
Stable: The relative order of elements with the same key value is preserved by the algorithm.
If after the first sort, an element is at its final position and subsequent iterations do not change its position, it is considered stable.
In-Place: Requires only a constant amount, i.e., O(1), of extra space during the sorting process.
Assigning a temporary variable takes up a small amount of constant space but is still counted as in-place.


Sorting Explanations
Merge Sort: For arrays, it requires significant space, but for Linked Lists, due to pointer manipulations, it does not require extra space.
Selection Sort: In each iteration, find the smallest element and swap it with the first index. Subsequent iterations process n-1 elements... Continue reading "Sorting Algorithms and Hashing Techniques" »