Pseudo code

The pseudo code for quicksort is very obvious based on what we have discussed so far:

QUICKSORT(Set, lo, high)

GET pivot

GENERATE Left, Right partitions

QUICKSORT(SET, lo, Left - 1)

QUICKSORT(SET, Right + 1, high)

As you can note in the preceding code, the algorithm is not very complex once we abstract out the logic to get the pivot.

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
3.133.108.68