In the video time complexity is O(N).
But shouldn’t it be O(NlogN) because we are sorting the numbers as well
Time complexity
hello @vishakha_narang
yeah it wil be O(NLOGN) if u use sort function.
but since element from pivot point onwards are sorted in ascending order,we can just reverse them in O(N) to get that part in ascending order
I hope I’ve cleared your doubt. I ask you to please rate your experience here
Your feedback is very important. It helps us improve our platform and hence provide you
the learning experience you deserve.
On the off chance, you still have some questions or not find the answers satisfactory, you may reopen
the doubt.