正在加载图片...
template <class Type> void Stack<Type>:: Push( Type item assert(!IsFull () ∥/先决条件断言 elements[++topl=item;∥/加入新元素 template <class Type> int stack<Type>:: Popoi if( IsEmpty() return0;栈空不退栈 top, return 1 ∥退出栈顶元素template <class Type> void Stack<Type> :: Push ( Type & item ) { assert ( !IsFull ( ) ); //先决条件断言 elements[++top] = item; //加入新元素 } template <class Type> int stack<Type> :: Pop ( ) { if ( IsEmpty ( ) ) return 0; //栈空不退栈 top--; return 1; //退出栈顶元素 }
<<向上翻页向下翻页>>
©2008-现在 cucdc.com 高等教育资讯网 版权所有