Sorting

Goal

Sorting an array of numbers using various algorithms and comparing their performance. Each algorithm has a unique method for arranging the numbers in order, known as linear-sorting, and the goal is to analyze their efficiency with different sizes of input data against traditional comparison-based sorting algorithms.

Note: Linear sorting refers to algorithms that can sort a list of items in time proportional to the number of items, or in linear time.

How it's Accomplished

Implement: Three linear-sorting algorithms: Counting Sort, Radix Sort, and Shellsort.

Test: By sorting random arrays of increasing size. Calculate an average run-time for each algorithm.

Graph: Display each sorting algorithms execution time on a graph to easily compare their performances.

Techniques Used

Counting Sort: Counts how many times each number appears and uses that information to place the numbers in order. Imagine counting how many of each type of card you have, then laying them out one by one in order.

Radix Sort: Sorts the numbers by looking at each digit one at a time, starting from the rightmost digit. It's like sorting cards based on their last number first, then going to the next number, and so on.

Shellsort: Sorts the list in stages. It first groups numbers and sorts those groups before putting everything together. Think of it like organizing a messy room by first tackling different sections before cleaning the whole space.

Analysis Visualization

data table
graph