Skip to content

svenvc/lampsort

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

14 Commits
 
 
 
 
 
 
 
 

Repository files navigation

lampsort

LampSort is a non-recursive implementation of QuickSort.

The core idea of QuickSort is not the elegant recursive implementation, but doing partitioning until there is nothing more to be done. The partition operation works on an interval over the data that we are sorting in place. It selects a pivot, which can be any element inside the interval, even just the first one as we are doing here, and then split the interval in 2 sub intervals: one with those elements smaller than the pivot and one with those elements larger than the pivot, moving elements around. The pivot is automatically left in the correct position. QuickSort loops, starting from the whole data interval, replacing it with consecutively smaller sub intervals, until only one element or empty intervals are left, which are sorted by definition.

For more information:

====

LampSortInstrumented is a version of LampSort that generates LampSortLogEvent objects while it runs. These log event object can be used to better understand the algorithm.

LampSortVisualized should be loaded on top of LampSort. It is an experimental package that requires Roassal2. It is easiest to load it in a Moose 5.1 image based on Pharo 4.

Please refer to the following article for more information:

About

LampSort, a non-recursive QuickSort

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published