Insertion Sort, Algorithms, Data Structure Algorithm, Coding Interviews, Job Hunting.
key > a[0], then we insert it after a[0]. After that, we make the key equal to the third element of the array. Then we will compare it with elements to its left and insert it in the right position. And we go on repeating this until the whole array is sorted. Pseudocode of insertion sort Step1: