QuickSort

QuickSort - 3 1 6 8 7 2 5 4 ^ 7 is large, the large region...

Info iconThis preview shows page 1. Sign up to view the full content.

View Full Document Right Arrow Icon
3 8 6 1 7 2 5 4 Quicksort Partitioning ^ example on page 241 3 is small, it becomes the first small number. Of Drake textbook 3 8 6 1 7 2 5 4 Blue is small region ^ Red is large region 8 is large, it becomes the first large number. ^ is 1 st unknown 3 8 6 1 7 2 5 4 Last number is pivot ^ 6 is large, the large region grows by one. 3 8 6 1 7 2 5 4 ^ 1 is small, swap it with first large number.
Background image of page 1
This is the end of the preview. Sign up to access the rest of the document.

Unformatted text preview: 3 1 6 8 7 2 5 4 ^ 7 is large, the large region grows by one. 3 1 6 8 7 2 5 4 ^ 2 is small, swap it with first large number. 3 1 2 8 7 6 5 4 ^ 5 is large, the large region grows by one. 3 1 2 8 7 6 5 4 ^ Swap the pivot with the first large number. 3 1 2 4 7 6 5 8...
View Full Document

This document was uploaded on 09/21/2009.

Ask a homework question - tutors are online