11-23-2024, 02:39 PM
Quicksort is strong when it comes to randomly arranged data.
The small differences to Shellsort arise from the specific arrangement of the random data.
Quicksort does not perform well when the data is pre-sorted. Shellsort handles both well.
Pre-sorting can be done for numbers from 255 down to 50 in steps of 0.2 as follows:
The small differences to Shellsort arise from the specific arrangement of the random data.
Quicksort does not perform well when the data is pre-sorted. Shellsort handles both well.
Pre-sorting can be done for numbers from 255 down to 50 in steps of 0.2 as follows:
Code:
GraphicsWindow.BackgroundColor = "Gray"
sorted = 255
'set up random array'
For r = 0 To rows-1
For c = 0 To columns-1
'red = Math.GetRandomNumber(256)-1
red = sorted
sorted = sorted - 0.2
'green = Math.GetRandomNumber(256)-1