Task 122 Quicksort

Back to Problem Solutions forum

anneenna     2020-05-05 03:19:45

Hi, I was able to sort the array properly but cant get the expected answer of L-R sequences. How do we choose the L-R boundaries each time? my logic: for left: start looking from leftmost, if n+1 > n, next. keep looking until n+1 < n. then n would be the pivot and left boundary. for right: if left boundary is still on the left side of the first pivot (from the very beginning), the start looking from the left of first pivot, position of first number that is less than left boundary will be the right boundary. However if left boundary is on the right side of first pivot then right boundary is len(array)-1

please help to tell me where I went wrong. I want to post my code but I can't private this post because I haven't solved the task yet.

thanks in advance

anneenna     2020-05-05 07:59:34

It's alright! I solved it! Admin if you could can you delete this post? Thanks!

Please login and solve 5 problems to be able to post at forum