A Comparison of Sorting Algorithms and their Efficiency
Sorting algorithms are used every day to perform different tasks. Often the importance of sorting algorithms is not realised. This report explores four sorting algorithms, namely, the insertion sort, double insertion sort, recursive insertion sort and the advanced bucket sort. The experimental work done on the four sorting algorithms mentioned above is discussed in the report. Moreover, the report describes the processes used by each algorithm to sort a list of objects, the strengths and weaknesses of each algorithm and the efficiency of each algorithm. This report is relevant because sorting algorithms are used in many programs and it is important to know which sorting algorithm to use in a given situation. Also, as BSc Information Science students it is important to understand sorting algorithms as they might be required in the work environment.
The following section investigates the basic insertionSort. This sorting algorithm sorts a list of items by inserting an element in its correct position in the list until it is sorted. Let us look at it in detail.
The basic idea of the insertionSort is to divide the list into two parts; a sorted portion and an unsorted portion. At each step of the algorithm, starting at the first element in the list, an element is moved from the unsorted portion to the sorted portion, until eventually the list is sorted. Sedgewick and Wayne 2011 states when implementing the algorithm in a computer, before inserting the current element into the emptied location, space needs to be made by moving the larger elements one position to the right in order to insert the current element in its c...
... middle of paper ...
...clusion, the experiment and report successfully described the performance of the sorting algorithms, how they work and also provoked critical thinking when contradictions were encountered.
Bruno R. Preiss, P., 1997. Example-Bucket Sort. http://www.brpreiss.com/books/opus4/html/page74.html.
Carrano, F. M., 2012, 2007, 2003. Data structures and Abstractions with Java. 3rd ed. New Jersey: Prentice Hall, Inc..
Chavey, D. P., 2010. Double Sorting: Testing Their Sorting Skills. Schedule of Conferences and Symposia, Volume 1, pp. 382-384.
Herschberg, D. S., 1978. Fast parallel sorting algorithms. Magazine communications of the ACM, 21(8).
Sedgewick, R. a. W., 2011. Algorithms. 4 ed. New Jersy: Pearson Education.
Stephens, R., 2013. Essential Algorithms A practical approach to computer algorithms. 1st ed. Indiana: John Wiley & Sons, Inc.