CIT Sorting Algorithm Tool is a react-based web app where we can visualize and play with algorithm designed for CIT students.
This project is meant to visualize four main sorting algorithms: merge sort, quick sort, heap sort and bubble sort, helping MCIT students to have a better understanding of sorting algorithms.
In the project directory, you can run:
Runs the app in the development mode.
Open http://localhost:3000 to view it in the browser.
You will also see any lint errors in the console.
- Bubble Sort
- Quick Sort
- Heap Sort
- Merge Sort
Bubble Sort is the simplest sorting algorithm that works by repeatedly swapping the adjacent elements if they are in the wrong order. This algorithm is not suitable for large data sets as its average and worst-case time complexity is quite high.
Time Complexity: O(N2)
Auxiliary Space: O(1)
QuickSort is a Divide and Conquer algorithm. It picks an element as a pivot and partitions the given array around the picked pivot. There are many different versions of quickSort that pick pivot in different ways. In this case, we pick the first element as the pivot.
Time Complexity is O(n log n)
Auxiliary Space: O(log n)
Heap sort is a comparison-based sorting technique based on Binary Heap data structure. It is similar to the selection sort where we first find the minimum element and place the minimum element at the beginning. Repeat the same process for the remaining elements.
Time Complexity: O(N2)
Auxiliary Space: O(1)
Merge sort is a sorting algorithm that works by dividing an array into smaller subarrays, sorting each subarray, and then merging the sorted subarrays back together to form the final sorted array.
In simple terms, we can say that the process of merge sort is to divide the array into two halves, sort each half, and then merge the sorted halves back together. This process is repeated until the entire array is sorted.
Time Complexity: O(Nlog(N))
Auxiliary Space: O(N)