正在加载图片...
Type Pop (); ∥/出栈 Type GetTop () ∥取栈顶 void MakeEmpty(){top=-1;}∥置空栈 int Is Empty const return top==-1; 3 int IsFull( const f return top=maxSize-1;) template <class Type> Stack<Type>:: Stack( int s): top(-1), maxSize(s)i elements= new Type]; assert( elements!=NULL);断言Type Pop ( ); //出栈 Type GetTop ( ); //取栈顶 void MakeEmpty ( ) { top = -1; } //置空栈 int IsEmpty ( ) const { return top == -1; } int IsFull ( ) const { return top == maxSize-1; } } template <class Type> Stack<Type> :: Stack ( int s ) : top (-1), maxSize (s) { elements = new Type[maxSize]; assert ( elements != NULL ); //断言 }
<<向上翻页向下翻页>>
©2008-现在 cucdc.com 高等教育资讯网 版权所有