Colour bar

Graphical Demo of Sorting Algorithms
for Windows CE

This was a demo I saw many years ago on a Xerox Smalltalk system (I think). I then adapted it for the Sinclair QL (and later the CST Thor).

The program is written in BasiCE for Windows CE Handheld PCs. You need BasiCE in order to run it. BasiCE is a freeware BASIC interpreter, and it can be downloaded at this address. When the BasiCE interpreter is running you select the Load command to load Gr_sorts, and then you select the Run command.

The idea is to display an array of elements to be sorted as points on the screen. The elements are the numbers from 1 up to the number of elements in the array. Imagine that the x-axis is the position in the array, and the y-axis is the value of the element. When sorted, position 1 should hold the value 1, position 2 the value 2, and so on. These points (1,1), (2,2), etc. will then form a oblique line from the bottom left to the top right. When completely unsorted, the points will appear to be placed randomly on the screen.

This is a screenshot of the sorted array:

Screenshot of unordered array

And this is an unordered array:

Screenshot of ordered array

Here we have bubble sort working:

Screenshot of Bubble Sort working

The following sorting algorithms are supported:

Radix Sort cannot be adequately shown with this kind of display, so it has been left out.

Download here (7 KB). Ready Visitors to this page:
00000

[Back to Home Page]