Quick sort algorithm can be divided into following steps
1) identify pivot.
2) Partition the linked list based on pivot.
3) Divide the linked list recursively into 2 parts.
Now, if I always choose last element as pivot, then identifying pivot element (1st step) takes O(n) time.
After identifying pivot element, we can store it's data and compare it with all other elements to identify correct partition point (2nd step). Each comparison will take O(1) time as we store the pivot data and each swap takes O(1) time. So in total it takes O(n) time for n elements.
So recurrence relation is
T(n) = 2T(n/2) + n which is O(nlogn) which is same as in merge sort with linked list.
So why is merge sort preferred over quick sort for linked list ?