Foreword
Sure enough, as the cumulative amount of multi-code, the focusing algorithms and data structures. The reason for this is because you want to have more gold content of the works produced, rather than producing a pile can not be maintained, unreadable garbage. In this way, not only to see himself this uncomfortable, others in maintaining your code when. Greeting words certainly missed.
Merge sort, by definition, the array has been sorted, merged together. So called merge sort.
Algorithm thinking
- The n records of length n as an ordered sub-table 1
- Normalized pairwise key and recording order to obtain the n / 2 sub-table length ordered 2
- Repeat Step merge into one knows all records ordered length n subtable
1 |
function (arr) { |
Original: Big Box talk merge sort