正在加载图片...
template <class Type> class datalist i public datalist( int maxsz= Defaultsize):∥构造函数 Max Size( maxsz ) CurrentSize(0) i vector=new Element <Type> [MaxSz; 3 void swap( Element<Type>&x,∥对换 Element <Type> &y) f Element<Type> temp=x;x=y; y=temp; 3 private Element<Type>* ector;∥存储向量 int max size, Currentsize;/最大与当前个数} template <class Type> class datalist { public: datalist ( int MaxSz = DefaultSize ) : //构造函数 MaxSize ( Maxsz ), CurrentSize (0) { Vector = new Element <Type> [MaxSz]; } void swap ( Element <Type> & x, //对换 Element <Type> & y ) { Element<Type> temp = x; x = y; y = temp; } private: Element <Type> * Vector; //存储向量 int MaxSize, CurrentSize; //最大与当前个数 }
<<向上翻页向下翻页>>
©2008-现在 cucdc.com 高等教育资讯网 版权所有