当前位置: 首页 > wzjs >正文

美妆网站怎么做深圳做网站哪个平台好

美妆网站怎么做,深圳做网站哪个平台好,网站建设描述书,做网站业务员提成几个点栈-Stack 1. 介绍2. 栈的实现2.1 基于链表的实现2.2 基于数组的实现 3. 栈操作CreateInitilizateDestoryPushPopTopEmptySize 1. 介绍 栈(stack) 是一种遵循先入后出逻辑的线性数据结构。顶部称为“栈顶”,底部称为“栈底”。把元素添加到栈…

栈-Stack

  • 1. 介绍
  • 2. 栈的实现
    • 2.1 基于链表的实现
    • 2.2 基于数组的实现
  • 3. 栈操作
    • Create
    • Initilizate
    • Destory
    • Push
    • Pop
    • Top
    • Empty
    • Size

1. 介绍

栈(stack) 是一种遵循先入后出逻辑的线性数据结构。顶部称为“栈顶”,底部称为“栈底”。把元素添加到栈顶的操作叫作“入栈”,删除栈顶元素的操作叫作“出栈”。
请添加图片描述

2. 栈的实现

2.1 基于链表的实现

请添加图片描述请添加图片描述请添加图片描述

2.2 基于数组的实现

请添加图片描述请添加图片描述
请添加图片描述

3. 栈操作

Create

typedef int STDataType;
typedef struct Stack
{STDataType* a;int top;int capacity;
}ST;

Initilizate

void STInit(ST* pst) {assert(pst);pst->a = NULL;//pst->top = -1;// top Points to the top of the stackpst->top = 0;// top Points to the next data on the top of the stackpst->capacity = 0;
}

Destory

void STDestory(ST* pst) {assert(pst);free(pst->a);pst->top = pst->capacity = 0;
}

Push

void STPush(ST* pst, STDataType x) {// Enpend capacityif (pst->top == pst->capacity) {int newCapacity = pst->capacity == 0 ? 4 : pst->capacity * 2;// If memblock is NULL, realloc behaves the same way as malloc and allocates a new block of size bytes. STDataType* tmp = (STDataType*)realloc(pst->a, newCapacity * sizeof(STDataType));if (tmp == NULL) {perror("relloc fail");return;}pst->a = tmp;pst->capacity = newCapacity;}pst->a[pst->top] = x;pst->top++;
}

Pop

void STPop(ST* pst) {assert(pst);assert(!STEmpty(pst));pst->top--;
}

Top

STDataType STTop(ST* pst) {assert(pst);assert(!STEmpty(pst));// top Points to the next data on the top of the stackreturn pst->a[pst->top - 1];
}

Empty

bool STEmpty(ST* pst) {assert(pst);return pst->top == 0;
}

Size

int STSize(ST* pst) {assert(pst);return pst->top;
}

文章转载自:

http://r9fTf18B.fsLxc.cn
http://PSPtktaY.fsLxc.cn
http://41BQIS7I.fsLxc.cn
http://uPhMxjA8.fsLxc.cn
http://GJBfjLm6.fsLxc.cn
http://0dwB1rUU.fsLxc.cn
http://3p21gO3i.fsLxc.cn
http://yrofdl0T.fsLxc.cn
http://NlRc5whK.fsLxc.cn
http://03R2TXYG.fsLxc.cn
http://IXgS1Qr1.fsLxc.cn
http://bqS7PQTj.fsLxc.cn
http://CBNlOWE6.fsLxc.cn
http://e6KeLHHE.fsLxc.cn
http://S6qHV2eN.fsLxc.cn
http://3wnRg2Pf.fsLxc.cn
http://Dm5GuPra.fsLxc.cn
http://uXlerU8f.fsLxc.cn
http://WGibXEej.fsLxc.cn
http://jeQ9bIPt.fsLxc.cn
http://CO9sTqsp.fsLxc.cn
http://G4Ox8I8O.fsLxc.cn
http://pOKqoUd4.fsLxc.cn
http://CoEuePbd.fsLxc.cn
http://VaXW0KbZ.fsLxc.cn
http://i6lAdFnt.fsLxc.cn
http://bhpyT9gQ.fsLxc.cn
http://hosdh4NX.fsLxc.cn
http://dxXajUaK.fsLxc.cn
http://KZH44MuN.fsLxc.cn
http://www.dtcms.com/wzjs/648807.html

相关文章:

  • 介绍几个网站上海市干部公示
  • 网站制作方案策划简历dj音乐网站建设开发
  • 摄影网站公司聚通装潢上海各门店地址电话
  • 酒店预订网站开发有哪些网站用mysql
  • 网站制作实验报告阿里云部署一个自己做的网站吗
  • 工会网站群建设设计参考图哪个网站好
  • wordpress网站布置广州网站优化快速提升网站排名
  • 在线购物网站建设流程个体户广告公司名字
  • 万网网站首页株洲在线论坛
  • 如何说服客户做网站网站开发手机模拟器
  • seo查询网站自己建站流程
  • 搞个竞拍网站怎么做网站建设得缺点
  • 求网页设计与网站建设方正隶变简体可以做网站用么
  • 科讯cms网站管理系统kesioncms注册送38元的游戏网站
  • 哪个专业是学网站开发的关于旅游网站建设的方案
  • 二手交易网站建设方案wordpress代码实现下载
  • 好公司的网站设计最新网站开发工具
  • 精诚时代 网站谁做的河南优化网站
  • 建设ca网站手机购物app排行榜前十名
  • 望京 网站建设wordpress用户密码 破解
  • 建设网站东莞公司上海网站建设seo推广
  • 黄岛王台有做网站的吗网页制作如何设置网页背景
  • 分类信息网站建设房屋设计软件免费版
  • 书法网站模版深圳做网站的地方
  • 网站 建设 公司加快建设乡镇招商网站
  • 德州网站建设招聘几度设计网站
  • 企业网站最下面的那栏叫啥厦门建网站网址
  • 大连企业建设网站南昌专业的学校网站建设公司
  • 建设网站是什么意思成都网站建设多少费用
  • 江苏网站建设包括哪些域名注册是什么意思