Visualization and Animation of Sorting Algorithms

Abstract

Sorting is one of the most important and challenging topics in the study of data structures and algorithm analysis. The time complexity of most sorting algorithms is in the range between 0(n^2 ) and O(n log n). Commonly used sorting strategies include: 1) sorting by exchanging adjacent elements, 2) sorting by using a binary tree structure, and 3) sorting by using a divide and conquer strategy. The typical examples of above sorting strategies are insertion sort, heapsort, and quicksort, respectively. The speed of a sorting process is heavily depended on the algorithm employed. For educational purposes, it is important for students to understand the underlying step by step processes of sorting algorithms. Visualization and animation of sorting algorithms may provide a useful aid to achieve this goal. The advantage of visualization is that it provides a direct sensation of a complicated abstract concept. This study visualized and animated the processes of insertion sort, two variants of heapsort, and quicksort, by displaying every single comparison, movement and exchange of each algorithm in detail. The study also executed and animated the four algorithms in the same time at the same screen for a same set of data to provide a real time comparison of different sorting algorithms. Finally, the study also compared and analyzed the performances of different algorithms for large data sets, based on the running time calculated from the counts of comparisons, swaps and moves that each algorithm took

    Similar works