The time complexity of quick sort is more difficult to analyze compared to merge sort. This is because the amount of time required depends on how the pivot is chosen.
Note that with recursive quick sort, the worst case time complexity also relates to the worst case stack usage. This can be rather important. The best case stack usage is log 2(n) recursions, in which n = |a|. In the worst case, there are n − 1 recursions. This difference is huge! For example, if an array has 1000000 records, the best case takes about 20 recursions. The worst case, however, takes 999999 recursions.
An attacker can utilize the weakness of quicksort to intentionally cause a stack overflow fault. Although it is unlikely to exploit the overflow condition to gain execution access, it is likely that the program will crash. Performance will certainly be adversely affected when quicksort needs to handle the worst case.