Counting Sort, Heap Sort, Quick Sort, and Maximum Subarray Problem