2013年12月6日星期五

The merge sort

I am reviewing for the knowledge we've learned this semester, and preparing for the coming final exam. Now I want to collect some useful information about the merge sort we've learned before. 

Merge sort is a recursive algorithm that continually splits a list in half. If the list is empty or has one item, it is sorted by definition (the base case). If the list has more than one item, we split the list and recursively invoke a merge sort on both halves. Once the two halves are sorted, the fundamental operation, called a merge, is performed. 

没有评论:

发表评论