Skip to content

BQingFan/VisualSorting

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

28 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

CIT Sorting Algorithm Tool

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.

Available Scripts

In the project directory, you can run:

npm start

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.

Algorithms

  • Bubble Sort
  • Quick Sort
  • Heap Sort
  • Merge Sort

Bubble 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)

Quick Sort

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

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

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)

Authors

Technologies


Acknowledgements

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Contributors 4

  •  
  •  
  •  
  •