正在加载图片...
int IsFull( const f return top=- maxSize-1; 3 private int tops /顶数组指针 Type elements;/|数组 int maxSize; 最大容量 template <class Type> Stack<Type>. Stack(int s): top(1), maxSize(s)i elements- new Typel l; assert( elements!=0);∥断言int IsFull ( ) const { return top == maxSize-1; } private: int top; //栈顶数组指针 Type *elements; //栈数组 int maxSize; //栈最大容量 } template <class Type> Stack<Type>:: Stack ( int s ) : top (-1), maxSize (s) { elements = new Type[maxSize]; assert ( elements != 0 ); //断言 }
<<向上翻页向下翻页>>
©2008-现在 cucdc.com 高等教育资讯网 版权所有