文件名称:stack2
-
所属分类:
- 标签属性:
- 上传时间:2012-11-16
-
文件大小:1.81kb
-
已下载:0次
-
提 供 者:
-
相关连接:无下载说明:别用迅雷下载,失败请重下,重下不扣分!
介绍说明--下载内容来自于网络,使用问题请自行百度
两个stack共享一个数组的存储空间
共享一个数组作为存储空间时,我们采用两个栈分别从左右两边开始存储,即可以定义top1和top2,分别作为两个栈的栈顶,stack1采用从前往后存,stack2采用从后往前存储,所以当两个栈都在存储,且总的存储空间不大于数组的长度时,该数组的空间将得到最大的利用。-The two share a stack array of storage space to share an array as storage space, we use two stacks left and right sides, respectively, starting from the store, which can be defined top1 and top2, respectively, as the two stack stack, stack1 with front to back deposit, stack2 used from the back storage, so when two stacks are in storage, and storage space is not greater than the total length of the array, the array will be the biggest use of space.
共享一个数组作为存储空间时,我们采用两个栈分别从左右两边开始存储,即可以定义top1和top2,分别作为两个栈的栈顶,stack1采用从前往后存,stack2采用从后往前存储,所以当两个栈都在存储,且总的存储空间不大于数组的长度时,该数组的空间将得到最大的利用。-The two share a stack array of storage space to share an array as storage space, we use two stacks left and right sides, respectively, starting from the store, which can be defined top1 and top2, respectively, as the two stack stack, stack1 with front to back deposit, stack2 used from the back storage, so when two stacks are in storage, and storage space is not greater than the total length of the array, the array will be the biggest use of space.
相关搜索: 两栈共享存储空间怎么
(系统自动生成,下载前可以参看下载内容)
下载文件列表
stack2.cpp
本网站为编程资源及源代码搜集、介绍的搜索网站,版权归原作者所有! 粤ICP备11031372号
1999-2046 搜珍网 All Rights Reserved.