From 043bf59c87ab669fc90f0c8f62f33f221c04e81c Mon Sep 17 00:00:00 2001 From: "Md. Jahidul Islam" <96673050+the-jahid@users.noreply.github.com> Date: Tue, 7 May 2024 16:42:13 +0600 Subject: [PATCH] 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 --- .../content/105-sorting-algorithms/102-insertion-sort.md | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/data/roadmaps/datastructures-and-algorithms/content/105-sorting-algorithms/102-insertion-sort.md b/src/data/roadmaps/datastructures-and-algorithms/content/105-sorting-algorithms/102-insertion-sort.md index 392c7cde4..73d9e1bc3 100644 --- a/src/data/roadmaps/datastructures-and-algorithms/content/105-sorting-algorithms/102-insertion-sort.md +++ b/src/data/roadmaps/datastructures-and-algorithms/content/105-sorting-algorithms/102-insertion-sort.md @@ -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. \ No newline at end of file +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)