2017春数据结构J
文章平均质量分 91
OrekiEru
这个作者很懒,什么都没留下…
展开
-
03-树2 List Leaves(java)
题目Given a tree, you are supposed to list all the leaves in the order of top down, and left to right.Input Specification:Each input file contains one test case. For each case, the first l原创 2017-04-08 11:01:47 · 204 阅读 · 0 评论 -
Java的队列和栈的使用
Java自带队列,而不必自己写一个 Queue queue = new LinkedList(); 注意是实例化的 LinkedList。常用操作:add 增加一个元索 如果队列已满,则抛出一个IIIegaISlabEepeplian异常remove 移除并返回队列头部的元素 如果队列为空,则抛出一个原创 2017-04-09 15:38:19 · 184 阅读 · 0 评论 -
03-树3 Tree Traversals Again
An inorder binary tree traversal can be implemented in a non-recursive way with a stack. For example, suppose that when a 6-node binary tree (with the keys numbered from 1 to 6) is traversed, the stac原创 2017-04-09 23:41:16 · 138 阅读 · 0 评论