摘要
在栈大小不受限制和栈大小受限制两种情况下,分析在给定入栈序列(1 2…n)的情况下,出栈序列应满足的性质,并据此给出基于穷举法和模拟入栈出栈过程的方法判断序列a1a2…an是否是出栈序列的算法及程序实现。算法较直观,易于理解,程序均经过测试,输出正确。
There are two cases that the size of stack is no limited and is limited. In stack-input(1, 2... n), the nature of stack-output is analysised, algorithm and program which is given based on the exhaustive method and simulation method of stack process is elaborated. Algorithms are more intuitive and easy to understand. Programs are tested and the outputs are correct.
出处
《微型机与应用》
2014年第21期10-12,15,共4页
Microcomputer & Its Applications
基金
新疆高校科研计划重点项目(XJEDU2014I039)
喀什师范学院教研教改重点项目(KJDZ1303
KJDZ1202)
喀什师范学院重点课题((13)2456)
关键词
栈
出栈序列
降序
算法
程序
stack
stack-output
direct subsequent
algorithm
program