栈在实际上有很多应用,比如说语法检查,判断平衡符号,函数的调用等等。
下面写了两个栈使用的例子。
1.Valid parenheses.
http://blog.csdn.net/chencheng126/article/details/40107109
2.Longest valid parentheses.
http://blog.csdn.net/chencheng126/article/details/40110907
另外在tree里面也有不少利用栈实现的例子:
1.二叉树的遍历
非递归的实现方式,就是使用栈来实现的
http://blog.csdn.net/chencheng126/article/details/44049033
2.二叉树的层次遍历
http://blog.csdn.net/chencheng126/article/details/40078439
用队列处理比较方便