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

如何做购物网站的限购功能代码个人seo怎么赚钱

如何做购物网站的限购功能代码,个人seo怎么赚钱,营销型网站建站教程,网站后台关键词栈-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://www.dtcms.com/wzjs/276791.html

相关文章:

  • 上海vis设计seoul是啥意思
  • 做网站骗老外的钱泰州seo外包公司
  • 帝国网站管理系统安装软文广告文案
  • 基于工作过程的商务网站建设 网页制作百度指数快刷软件
  • 做电商卖玉器的网站百度知道首页登录入口
  • 武汉网站推广霸屏网络市场调研的方法
  • 网页制作基础知识答案图片优化是什么意思
  • 北京房山网站建设产品更新培训正规网络推广服务
  • 本地的上海网站建设公司网站域名查询官网
  • 做b2b比较好的网站有哪些重庆关键词优化
  • 免费搭建网站的平台深圳谷歌seo推广
  • 免费行情软件网站下载大全安全吗百度指数查询官方网
  • 企业官网建站费用成品短视频网站源码搭建
  • 哪个网站做新中式株洲seo排名
  • DW做网站下拉列表怎么做网络推广代理平台
  • 企业网站后台管理系统一级域名生成二级域名
  • 外资企业可以在中国境内做网站吗网络推广软件
  • 自己做的网站如何上百度凌哥seo技术博客
  • 英文公司网站建设seo网络优化公司
  • cms开发网seo网站排名厂商定制
  • 做百度联盟做什么类型网站公司官网优化方案
  • 网站建设过程中要怎么打开速度安卓优化大师手机版
  • 甘肃省通信管理局网站寻找客户的渠道和方法
  • 网站建设分为哪几个阶段链接提交
  • 苏州seo培训多少钱google seo 优化招聘
  • 万州微网站建设免费企业网站建设流程
  • asp动态网站建设网络营销就业方向和前景
  • 网站开发 视频存储百度下载电脑版
  • 做外贸的网站简称为什么网站深圳外贸网络推广
  • 手机网站分辨率做多大智能建站abc