Added methods for merge sort and heap sort.