您当前的位置: 首页 > 

第三章 栈和队列

钟钟终 发布时间:2022-06-27 20:07:00 ,浏览量:2

顺序栈的实现
#include 

using namespace std;
const int N=1e4+5;
class Seqstack
{
public:
    Seqstack();
    ~Seqstack(){}
    void Push(int k);
    int Pop();
    bool Empty();
    int Gettop();
private:
    int data[N];
    int top;
};
Seqstack::Seqstack()
{
    top=-1;
}
void Seqstack::Push(int k)
{
    if(top==N)
    {
        cout            
关注
打赏
1688896170
查看更多评论
0.0850s