Data Structures
Quick Sort Implementation
Quick sort explained: partition around a pivot and recurse. O(n log n) average, in-place, with the Lomuto partition in Python, Java and C++.
2 notes tagged
Quick sort explained: partition around a pivot and recurse. O(n log n) average, in-place, with the Lomuto partition in Python, Java and C++.
Merge sort explained: divide the array in half, sort each half, then merge. Guaranteed O(n log n), stable, with Python, Java and C++ code.