用数组实现栈 Array implementation of stacks
来源:互联网 发布:苹果电脑装cad软件 编辑:程序博客网 时间:2024/04/30 00:45
#include <iostream>using namespace std;#define MAXSIZE 4int A[MAXSIZE];int top = -1;void Push(int x){if(top == MAXSIZE-1)return;A[++top] = x;}void Pop(){if(-1 != top)top--;}int Top(){if(-1 != top)return A[top];}void PrintStack(){for(int i = 0; i <= top; i++)cout << A[i] <<" ";cout << endl;}
0 0
- 用数组实现栈 Array implementation of stacks
- 用单链表实现栈 Linked List implementation of stacks
- 栈(stacks)数组实现
- 栈(stacks)可变数组实现
- 【基础知识】An Implementation of Double-Array Trie
- An Implementation of Double-Array Trie
- An Implementation of Double-Array Trie
- An Implementation of Double-Array Trie
- 无锁队列的环形数组实现(Lock Free Queue Implementation in Ring Array)
- Chapter 3 | Stacks and Queues--一个数组实现三个栈
- Yet another implementation of a lock-free circular array queue
- Yet another implementation of a lock-free circular array queue
- Program work 3. Implementation of Deque using array
- 用数组实现栈(Stacks)、队列(Queue)和双向链表(Doubly Linked List)的伪代码
- 对象数组(Array of Objects)
- ES2015数组拓展 - Array.of()
- ES2015数组拓展 - Array.of()
- Implement Queue using Stacks(用栈实现队列)
- 国务院:建立统一城乡居民基本养老保险制度
- 解决VMWare无权注册的问题
- 开发一个真实的 OSGi 应用程序
- vmware下ubuntu升级完成后无法上网
- Linux 抽象网络设备简介
- 用数组实现栈 Array implementation of stacks
- Merge Intervals
- 14年生日,教大家制作相册视频
- 封存记忆
- sicily_1388_Quicksum
- Garbage collection roots
- HBase权威指南 翻译
- 2014新年第一篇
- C++标准库总结