Insert sort
Insertion sort works much like sorting cards in a card game. When we begin to draw cards, our left hand is empty and the cards are placed face down on the table. Next, pick up one card at a time from the table and insert it into the correct position in the left hand. To find the correct position of this card, compare it with each card in your hand from right to left.
The pseudocode for the algorithm is as follows:
INSERTION-SORT(A)1 for j