Insert Sort, Merge Sort and Quick Sort

IntroductionInsert Sort AlgorithmStraight Insertion Sort: Think of n elements to be sorted as an ordered table and an unordered table. At the beginning, the ordered table contains only 1 element, while the unordered table contains n-1 elements. In the sorting process, the first element is taken out of the unordered table every time and inserted into the appropriate position in the ordered table to make it a new ordered table. Repeat n-1 times to complete the sorting process. What we should do: Take the first number in the disordered region and find its corresponding position in the ordered region. Insert the data in the unordered region into the ordered region; If necessary, the relevant data in the ordered region is shifted.

Posted on Data Structure and Algorithm