Sort POJ- - merge sort of the reverse

Sort: merge sort of the reverse

First, the concept

Merge sort (MERGE-SORT) is based on an efficient operation of merge sorting algorithm, which is very typical application uses a divide and conquer (Divide and Conquer) a. The combined sequence has been ordered, fully ordered sequence; i.e., each first ordered sequence, and then ordered to make inter-segment sequences. If two merged into a sorted list ordered list, called way merge.

Second, the algorithm description

1. For the same ordered array of two, first determines the size of the first two sets of numbers, and will retain a small number to a new array.
2. Then compare the number of teams than the second and the first digit of another group, still retain a smaller number, thus ensuring an orderly array of new, important to note that when any one set of numbers is empty, naturally the remaining count of the other group received a new array (because the rest of the tree is certainly more than just go into large).

Third, the reverse of

 
 

 

Guess you like

Origin www.cnblogs.com/yun-an/p/11097712.html