there is an error in the code, in partition function on one of the two inner while loops that increment the left position and decrement the right one you need to put = instead of > in the second while loop) or else the code will loop infinitely if there are two values that are the same in the array because it will swap them infinitely
Can you tell how O(logn) space complexity in worst case scenario? Your vedios are really good. One suggestion is to reduce the speed it's difficult to follow. Thanks
Worse case scenario would be if the elements are already sorted ... I think O notation would depend on how you chose the pivot point .. I was told it would be worse than log n
You have no idea how good your videos are.
That's super kind, thanks a lot
there is an error in the code, in partition function on one of the two inner while loops that increment the left position and decrement the right one you need to put = instead of > in the second while loop) or else the code will loop infinitely if there are two values that are the same in the array because it will swap them infinitely
Can you tell how O(logn) space complexity in worst case scenario? Your vedios are really good. One suggestion is to reduce the speed it's difficult to follow. Thanks
Worse case scenario would be if the elements are already sorted ... I think O notation would depend on how you chose the pivot point .. I was told it would be worse than log n
the speed was a little too much