Archives:

quick sort No ratings yet.

Quick sort High level code are quite simple ( divide/conque, recursively partition the array): void quickSort(int arr[], int low, int high) {     if (low < high)     {         /* pi is partitioning index, arr[p] is now            at right place */         int pi = partition(arr, low, high);         // Separately sort elements before         // partition and after partition • Read More »


Heap and Heapsort No ratings yet.

Heap/Heapsort is not difficult to understand when you reading online articles/watching online videos, but without using it everyday, it is quite easy to forget the evil details. Here are some notes to help memorizing this. (1) Min/Max heap, is a  a Complete Binary Tree with its parent nodes smaller or greater than its two children. a A • Read More »