Insertion Sort
insertion sort Bubble Sort,; Selection Sort,; Insertion Sort They are called comparison-based as they compare pairs of elements of the array and decide whether to swap them Insertion sort essentially works as per its name As the name goes, it basically inserts the element at its correct position by following a step
Insertion sort works especially well when the input data size is relatively small andor when most of the data items are already or nearly Insertion Sort Algorithm · It is efficient for smaller data sets, but very inefficient for larger lists · Insertion Sort is adaptive, that means it reduces its
Applications of insertion sort · Sorting a hand of playing cards according to the numbers and colors · Sorting shirts in a closet according to Time Complexity of an Insertion Sort · In the above algorithm, one statement is present, a for loop with three statements and a nested while loop that contains