您的位置:首页 > 其它

Insertion Sort, Merge Sort

2013-10-28 19:14 267 查看
Insertion Sort, Merge Sort

Merge Sort assumes that two sorted arrays as input:

  [1,2,3,8,9,10] could to be splited as  [1,3,8],  [2,9,10]; first 1 and 2  could do a comparision, the 1 will be put down; then 3 will be compared with 2,

  then 2 will be write down, and so on, so forth; [1,2,3,8,9,10]

Inserting sort:

In place merge sort:

test it in the python meger sort and insert sort;

 

Models of Computation, Document Distance

--Models of computation specifies what operations an algorithm is allowed

--cost(time) of each operations

 

 
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: