数据结构与算法培训讲学.pptVIP

  • 2
  • 0
  • 约1.2万字
  • 约 67页
  • 2019-11-03 发布于天津
  • 举报
数据结构与算法;作为抽象数据类型的数组;一维数组的特点;数组的定义和初始化;一维数组(Array)类的定义; ~Array( ) { delete [ ]elements;} ArrayType operator = ( const ArrayType A ); Type operato [ ] ( int i ); operator Type * ( ) const { return elements; } int Length ( ) const { return ArraySize; } void ReSize ( int sz ); }; template class Type void ArrayType::getArray ( ) { //私有函数:创建数组存储空间 elements = new Type[ArraySize]; if ( elements == 0 ) cerr Memory Allocation Error endl; }; template class Type v

文档评论(0)

1亿VIP精品文档

相关文档