Add resource for Insertion Sort (#5591)
* Update 102-insertion-sort.md Added insertion sort link from w3 school and also added advantages , disadvantages about insertion sort * Reformat links --------- Co-authored-by: Kamran Ahmed <kamranahmed.se@gmail.com>pull/5610/head
parent
3e0d8a5b3d
commit
043bf59c87
1 changed files with 3 additions and 1 deletions
@ -1,3 +1,5 @@ |
||||
# Insertion Sort |
||||
|
||||
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 - W3Schools](https://www.w3schools.com/dsa/dsa_algo_insertionsort.php) |
||||
|
Loading…
Reference in new issue