Opus5.Experiment2

Explanation

This program measures the running times of various sorters: StraightInsertionSorter, BinaryInsertionSorter, StraightSelectionSorter, BubbleSorter, HeapSorter, MedianOfThreeQuickSorter, TwoWayMergeSorter, BucketSorter, and RadixSorter.

The source code for the main method is available here.

Instructions

This is a non-interactive program that creates arrays of random integers of various sizes and then sorts those arrays using the various sorters listed above. The output consists of the name of the sorter, the length of the array, the value used to seed the random number generator, and the time taken by the sorter (in seconds).


Bruno
Copyright © 1999 by Bruno R. Preiss, P.Eng. All rights reserved.