您当前的位置: 首页 > 

钟钟终

暂无认证

  • 2浏览

    0关注

    233博文

    0收益

  • 0浏览

    0点赞

    0打赏

    0留言

私信
关注
热门博文

第三章 栈和队列

钟钟终 发布时间: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            
关注
打赏
1664378814
查看更多评论
0.0456s