/insertion-sort-demo

🌈 Demo of insertion sort for algorithm beginners!

Primary LanguageJavaScript

Insertion Sort Demo

DEMO: https://insertion-sort-demo.herokuapp.com/ insertionsort

Summary

Insertion is one way to sort an array of numbers. Data is divided into sorted and unsorted portions. One by one, the unsorted values are inserted into their appropriate positions in the sorted subarray. 

Reference: (CS50 Study: https://study.cs50.net/insertion_sort)

Technologies Used

  • jQuery
  • HTML
  • CSS
  • Animate.css
  • Jasmine

Get Started

bower install jquery --save
bower install animate.css --save
bower install jasmine --save

Then open html with a browser!

Time complexity

Best case —> О(n) [1, 2, 3, 4, 5, 6, 7]

Worst case —> O(n2) [7, 6, 5, 4, 3, 2, 1]

Average case —> О(n2) [4, 3, 5, 6, 7, 2, 1]