heap, countsort and min max