
数据结构
文章平均质量分 84
sunny1996
这个作者很懒,什么都没留下…
展开
-
逆波兰表达式的树状解法
描述 一个四则运算算术表达式,只包含“(”,“)”,“+”,“-”,“*”,“/”,括号可嵌套,利用有向无环图的邻接表达式存储,每个操作数原子都由一个小写字母表示。写一个算法输出其逆波兰表达式(又称后缀表达式)。 输入输入长度不超过100的四则运算表达式,中间没有空格,以’#’结尾。 输出输出表达式对应的逆波兰表达式 输入样例(a+b)*c 输原创 2016-04-10 23:26:41 · 2475 阅读 · 0 评论 -
POJ2352 Stars(线段树进阶)
DescriptionAstronomers often examine star maps where stars are represented by points on a plane and each star has Cartesian coordinates. Let the level of a star be an amount of the stars that ar原创 2015-04-25 20:40:34 · 391 阅读 · 0 评论 -
POJ3264 Balanced Lineup(线段树入门)
DescriptionFor the daily milking, Farmer John's N cows (1 ≤ N ≤ 50,000) always line up in the same order. One day Farmer John decides to organize a game of Ultimate Frisbee with some of the co原创 2015-04-24 22:18:55 · 319 阅读 · 0 评论 -
POJ1363 Rail (经典栈的运用)
DescriptionThere is a famous railway station in PopPush City. Country there is incredibly hilly. The station was built in last century. Unfortunately, funds were extremely limited that time.原创 2015-02-25 18:35:47 · 582 阅读 · 0 评论 -
POJ3125 printer(队列的使用)
DescriptionThe only printer in the computer science students' union is experiencing an extremely heavy workload. Sometimes there are a hundred jobs in the printer queue and you may have to wai原创 2015-02-25 18:22:23 · 445 阅读 · 0 评论 -
广义表的建立与求深度
广义表是一种比较复杂的线性表,它的原子要么是元素,要么是子表,表中除了表头元素以外其他全是表尾,所以表尾一定是子表类型。时限:1000ms 内存限制:10000K 总时限:3000ms描述按表头、表尾的分析方法重写求广义表深度的递归算法 输入输入一串以'('开始,以')'结束的字符串,并且输入的左右括号必须匹配,如:(),(()).. 输出分别输出按表头、原创 2016-04-30 22:44:02 · 1177 阅读 · 0 评论 -
noj1202数独游戏
描述数独游戏规则 在9阶方阵中,包含了81个小格(九列九行),其中又再分成九个小正方形(称为宫),每宫有九小格。 游戏刚开始时,盘面上有些小格已经填了数字(称为初盘),游戏者要在空白的小格中填入1到9的数字,使得最后每行、每列、每宫都不出现重复的数字,而且每一个游戏都只有一个唯一的解答(称为终盘)。 输入一个9*9的矩阵,0表示该位置是空白。 输出一个9*9原创 2016-06-28 18:06:01 · 421 阅读 · 0 评论