Quantcast
Channel: Quicksort with last element as pivot not sorting - Stack Overflow
Browsing all 2 articles
Browse latest View live

Answer by trincot for Quicksort with last element as pivot not sorting

The main issue is that you are not always comparing with the pivot value. Your code assumes it is at i, but that will not be true once the j loop doesn't find anything to swap. In that case your outer...

View Article



Quicksort with last element as pivot not sorting

I have an assignment to create a quicksort algorithm which chooses the last element as the pivot element. Further inside the partition() function when an Element n is found which is greater or equal to...

View Article
Browsing all 2 articles
Browse latest View live




Latest Images