Analysis of quick sort and merge sort