Sir if merge sort has same o(nlog n)avg . and worst case and quick sort has o(n^2) complexity, why should we refer quick sort against merge sort?
Merge sort vs quick sort
Mergesort uses extra space, quicksort requires little space and exhibits good cache locality. Quick sort is an in-place sorting algorithm. In-place sorting means no additional storage space is needed to perform sorting. Merge sort requires a temporary array to merge the sorted arrays and hence it is not in-place giving Quick sort the advantage of space.
Quicksort in particular exhibits good cache locality and this makes it faster than merge sort in many cases like in virtual memory environment.