数据结构之 顺序栈的操作
来源:互联网 发布:mac如何打开jar文件 编辑:程序博客网 时间:2024/05/29 06:47
// 栈.cpp : 定义控制台应用程序的入口点。//#include "stdafx.h"#include "malloc.h"#define maxSize 100 typedef struct {int data[maxSize];int top;}SqStack;void push(SqStack &st,int x){if(st.top==maxSize-1)return;st.top++;st.data[st.top]=x;}void pop(SqStack &st,int &x){if(st.top==-1)return;x=st.data[st.top];st.top--;return;}void show(SqStack &st){if(st.top==-1)return;int x;while(st.top!=-1){pop(st,x);printf("%d ",x);}}void initSqStack(SqStack &st){st.top=-1;}int _tmain(int argc, _TCHAR* argv[]){SqStack L;initSqStack(L);for(int i=1;i<=10;i++)push(L,i);show(L);}
以上代码实现了顺序栈的各种操作
- 数据结构之 顺序栈的操作
- 数据结构之顺序栈的操作(C语言)
- 数据结构之顺序栈的操作(C语言)
- 数据结构之对顺序栈的操作(C语言版)
- 数据结构之顺序栈的一些基本操作
- 数据结构之顺序表的基本操作
- 数据结构之顺序串的基本操作
- 数据结构之顺序表的操作
- 数据结构之顺序表操作
- 数据结构顺序栈的各种操作
- 数据结构--顺序栈的基本操作
- 数据结构 顺序栈的基本操作
- 【数据结构】 简单静态顺序栈的操作
- 【数据结构】顺序栈的基本操作
- 【数据结构】顺序栈的基本操作
- 数据结构之顺序队列的操作(C语言)
- 数据结构之顺序队列的操作(C语言)
- 数据结构—线性表之顺序表的操作
- 静态链表的创建以及基本操作
- 蚂蚁爬行问题
- tomcat6.0 /7.0安装版内存溢出设置
- Spring中AOP与IOC
- using与try catch
- 数据结构之 顺序栈的操作
- Linux文件特殊权限
- 树状数组()
- 大数斐波那契数列
- coding kata
- 杭电acm足迹
- POJ 1001
- Why Are Thread.stop, Thread.suspend, Thread.resume and Runtime.runFinalizersOnExit Deprecated?
- POJ 3528 三维凸包模板