Update 102-insertion-sort.md (#7019)

add visualisation to insertion sort
pull/7021/head
ingar 3 months ago committed by GitHub
parent 1e6fa6d8c6
commit c2c122e4dc
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
  1. 1
      src/data/roadmaps/datastructures-and-algorithms/content/105-sorting-algorithms/102-insertion-sort.md

@ -3,3 +3,4 @@
Insertion sort is a simple sorting algorithm that builds the final sorted array (or list) one item at a time. It's much less efficient on large lists than more advanced algorithms like quicksort, heapsort, or merge sort. Still, it provides several advantages such as it's easy to understand the algorithm, it performs well with small lists or lists that are already partially sorted and it can sort the list as it receives it. The algorithm iterates, consuming one input element each repetition and growing a sorted output list. At each iteration, it removes one element from the input data, finds the location it belongs within the sorted list and inserts it there. It repeats until no input elements remain. Insertion sort is a simple sorting algorithm that builds the final sorted array (or list) one item at a time. It's much less efficient on large lists than more advanced algorithms like quicksort, heapsort, or merge sort. Still, it provides several advantages such as it's easy to understand the algorithm, it performs well with small lists or lists that are already partially sorted and it can sort the list as it receives it. The algorithm iterates, consuming one input element each repetition and growing a sorted output list. At each iteration, it removes one element from the input data, finds the location it belongs within the sorted list and inserts it there. It repeats until no input elements remain.
- [@article@Insertion Sort - W3Schools](https://www.w3schools.com/dsa/dsa_algo_insertionsort.php) - [@article@Insertion Sort - W3Schools](https://www.w3schools.com/dsa/dsa_algo_insertionsort.php)
- [@article@Insertion Sort Visulation](https://www.hackerearth.com/practice/algorithms/sorting/insertion-sort/visualize/)

Loading…
Cancel
Save