Article Preview
Buy Now
COLUMN
Quicksort
Part II
Issue: 5.5 (July/August 2007)
Author: Charles Yeomans
Author Bio: Charles is the author of "I Declare: Calling External Functions in REALbasic", available online at
Article Description: No description available.
Article Length (in bytes): 11,572
Starting Page Number: 42
Article Number: 5515
Related Web Link(s):
http://www.declareSub.com/
Excerpt of article text...
In the previous installment of this column, I worked through the basic version of the quicksort algorithm. It is this: given an array, pick an element, and call it the pivot. Move all elements of the array less than the pivot to the left, and all elements of the array greater than the pivot to the right. Afterward, the pivot element is in its sorted position. Now repeat this process on the two subarrays to the left and the right of the pivot.
I also discussed some optimization of this algorithm in the course of implementing it; I recall the code here.
Sub QuickSort(theList() as Integer, firstIndex as Integer, lastIndex as Integer)
...End of Excerpt. Please purchase the magazine to read the full article.