ReadMe.txt
资源名称:ds1-3.rar [点击查看]
上传用户:chaiyuqiu
上传日期:2022-08-03
资源大小:27k
文件大小:1k
源码类别:
数据结构
开发平台:
C/C++
- #ifndef SELECTTM_H
- #define SELECTTM_H
- #include "datalist.h"
- template <class Type> void dataList <Type>::Swap (const int mark1, const int mark2) {
- Type temp = Element[mark1];
- Element [mark1] = Element [mark2];
- Element [mark2] = temp;
- }
- template < class Type> void dataList <Type>::MaxKey(const int low, const int high) {
- int max = low;
- if ( k >= ArraySize ) k = ArraySize - 1;
- for (int k = low+1, k <= high, k++)
- if ( Element[max] < Element[k] ) max = k;
- return max;
- }
- template <class Type> ostream& operator << (ostream& outStream, const dataList <Type> outList) {
- outStream << "Array Contents:n" ;
- for (int i = 0; i < outList ; i++)
- outStream << outList.Element[i] << ' ' ;
- outStream << endl;
- outStream << "Array Curre