文件名称:mergeosrt
- 所属分类:
- 控制台(字符窗口)编程
- 资源属性:
- [C/C++] [源码]
- 上传时间:
- 2012-11-26
- 文件大小:
- 1kb
- 下载次数:
- 0次
- 提 供 者:
- 马*
- 相关连接:
- 无
- 下载说明:
- 别用迅雷下载,失败请重下,重下不扣分!
介绍说明--下载内容均来自于网络,请自行研究使用
申请空间,使其大小为两个已经排序序列之和,该空间用来存放合并后的序列
设定两个指针,最初位置分别为两个已经排序序列的起始位置
比较两个指针所指向的元素,选择相对小的元素放入到合并空间,并移动指针到下一位置
重复步骤3直到某一指针达到序列尾
将另一序列剩下的所有元素直接复制到合并序列尾-Application space, so the size of the two already sorted sequences, and, after the merger of the space used to store the sequence of two pointers to set initial position of the two already sorted sequences were the starting position by comparing two pointers point to elements, select elements into a relatively small space to merge, and move the pointer to the next location Repeat step 3 until the end of a pointer to sequence all of the other sequence elements direct the remaining copy to the end of the merger sequence
设定两个指针,最初位置分别为两个已经排序序列的起始位置
比较两个指针所指向的元素,选择相对小的元素放入到合并空间,并移动指针到下一位置
重复步骤3直到某一指针达到序列尾
将另一序列剩下的所有元素直接复制到合并序列尾-Application space, so the size of the two already sorted sequences, and, after the merger of the space used to store the sequence of two pointers to set initial position of the two already sorted sequences were the starting position by comparing two pointers point to elements, select elements into a relatively small space to merge, and move the pointer to the next location Repeat step 3 until the end of a pointer to sequence all of the other sequence elements direct the remaining copy to the end of the merger sequence
(系统自动生成,下载前可以参看下载内容)
下载文件列表
mergeosrt.cpp