文件名称:stack2
介绍说明--下载内容均来自于网络,请自行研究使用
两个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