- 博客(4)
- 收藏
- 关注
原创 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 141
原创 Java的队列和栈的使用
Java自带队列,而不必自己写一个 Queue queue = new LinkedList(); 注意是实例化的 LinkedList。 常用操作: add 增加一个元索 如果队列已满,则抛出一个IIIegaISlabEepeplian异常 remove 移除并返回队列头部的元素 如果队列为空,则抛出一个
2017-04-09 15:38:19 188
原创 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 206
转载 02-线性结构4 Pop Sequence
Given a stack which can keep MM numbers at most. Push NN numbers in the order of 1, 2, 3, ..., NN and pop randomly. You are supposed to tell if a given sequence of numbers is a possible pop sequ
2017-03-18 18:05:54 185
空空如也
空空如也
TA创建的收藏夹 TA关注的收藏夹
TA关注的人