
list queue and stack
文章平均质量分 80
Geterns
这个作者很懒,什么都没留下…
展开
-
前缀表达和后缀表达
Construct a binary tree for the defined expression, and show result of pre-order and post-order.Example:Input:(a+b)*(c/(d-e))Output:*+ab/c-deab+cde-/*数据结构老师出的实验题,原意是要我们建立表达式树来解决,不过我刚好在树上看到一种O(n)的算法,于是用着这方法写了一下,答案是一样的。里面用到的栈模板是我以前写好的,直接复制过来用~~~#include #i原创 2010-11-28 18:46:00 · 314 阅读 · 0 评论 -
USACO: Camelot
<br />Camelot<br />IOI 98<br />Centuries ago, King Arthur and the Knights of the Round Table used to meet every year on New Year's Day to celebrate their fellowship. In remembrance of these events, we consider a board game for one player, on which one ches原创 2011-01-05 01:51:00 · 333 阅读 · 0 评论