I have learnt about recursive quick sort and it takes O(nlogn) for best case and O(n^2) for worst case. But i am trying to find time complexity of iterative quick sort.I know it is O(nlogn) for best case and O(n^2). But i am not to justify it for the best case. I am following this tutorial
https://www.techiedelight.com/iterative-implementation-of-quicksort/
say we have 15 elements such that the pivot index postions will always be in the middle making it ideal best case scenario. But i find it the conditon "while (!stack.empty())" i.e the number of partitions will happen for 6 times which is not close to log(n). How one can justify the time complexity of best case in iterative quick sort is O(nlogn).?