?? astack.h
字號:
#ifndef ASTACK_H_H
#define ASTACK_H_H
template<class Elem>class AStack{
public:
int size;
int top;
Elem* listArray;
public:
AStack(int sz=DefaultListSize)
{size=sz;top=0;listArray=new Elem[sz];}
~AStack(){delete [] listArray;}
void clear(){top=0;}
bool push(const Elem& item){
if(top==size) return false;
else{listArray[top++]=item;return true;}
}
bool pop(Elem& item){
if(top==0) return false;
else{item=listArray[--top];return true;}
}
bool topValue(Elem& it)const{
if(top==0) return false;
else{it=listArray[top-1];return true;}
}
int length()const{return top;}
};
#endif
?? 快捷鍵說明
復制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -