User:Bhavya 1207/sandbox

ANALYSIS INSERTION SORT ALGORITHM ➢	Introduction The arrangement of data in a specific order (ascending or descending) is termed sorting in data structures. Sorting data makes it easier to search through a given data sample, efficiently and quickly. Since sorting can often help reduce the algorithmic complexity of a problem, it finds significant uses in computer science. ➢	Types of Sorting

●	Comparison-based sorting: In comparison-based sorting techniques, a comparator is defined to compare elements or items of a data sample. This comparator defines the ordering of elements. Examples are: Bubble Sort, Merge Sort. ●	Counting-based sorting: There's no comparison involved between elements in these types of sorting algorithms but rather work on calculated assumptions during execution.

●	In-Place vs Not-in-Place Sorting: In-place sorting techniques in data structures modify the ordering of array elements within the original array. On the other hand, Not-in-Place sorting techniques use an auxiliary data       structure to sort the original array. ➢	INSERTION SORTING ALGORITHM

Insertion sort is a sorting algorithm in which the given array is divided into a sorted and an unsorted section. In each iteration, the element to be inserted has to find its optimal position in the sorted subsequence and is then inserted while shifting the remaining elements to the right The array is virtually split into a sorted and an unsorted part. Values from the unsorted part are picked and placed at the correct position in the sorted part.

➢	STEPS ➢	APPLICATION-BASED ON REAL-LIFE
 * .If it is the first element, it is already sorted.
 * .Pick the next element.
 * .Compare with all the elements in sorted sub-list.
 * .Shift all the elements in a sorted sub-list that are greater than the value to be sorted.
 * .Insert the value.
 * .Repeat until the list is sorted.

1.	The contact list in your phone is sorted, which means you can easily access your desired contact from your phone since the data is arranged in that manner for you. In other words, “it is sorted”.

2.	While shopping on flip kart or amazon, you sort items based on your choice, that is, price low to high or high to low

3.	The app docker on your phone is an easily relatable example.

➢	CONCLUSION:

Insertion Sort works best with a small number of elements. The worst-case runtime complexity of Insertion Sort is o(n2) similar to that of Bubble Sort. However, Insertion Sort is considered better than Bubble sort

➢	REFERENCE LINK

https://www.crio.do/blog/top-10-sorting-algorithms/