The document discusses two sorting algorithms: Quicksort and Mergesort. Quicksort works by picking a pivot element and partitioning the array around that pivot, recursively sorting the subarrays. It has average time complexity of O(n log n) but worst case of O(n^2). Mergesort works by dividing the array into halves, recursively sorting the halves, and then merging the sorted halves together. It has time complexity of O(n log n) in all cases. The document also includes Java code for implementing MergeSort and discusses how it works.