一直想要写的 二叉树 中序 先序 后序遍历算法
递归的太简单了,就不写了。关键是非递归版本。
先序:
我自己的版本:
void RootPreTraverse(Node* p)
{
Stack S;
while(S not empty)
{
p=S.top();
S.pop();
Show(p);
if(p->right!=null)
S...
分类:
其他好文 时间:
2014-06-20 10:55:49
阅读次数:
279
List Class
Stack Class
Queue Class
SortedSet Class
System.Collections Class
ArrayList
表示动态大小的对象集合,其中的对象是按顺序列出的
IList ICollection IEnumerable ICloneable
BitA...
分类:
其他好文 时间:
2014-06-20 10:13:11
阅读次数:
190
apache
commons下的pool其中的borrowObject函数源代码显示其产生可用对象的过程:
如果stack中有空闲的对象,则pop对象,激活对象(activate函数),验证对象(validate函数)。最终将合格的对象返回给client。
若对象在这个流程中出错,则在从stack中...
分类:
其他好文 时间:
2014-06-11 22:44:15
阅读次数:
352
1 /* 2 Design and implement a data structure
for Least Recently Used (LRU) cache. It should support the following operations:
get and set. 3 ...
分类:
其他好文 时间:
2014-06-11 13:08:46
阅读次数:
297
sharepoint学习笔记汇总http://blog.csdn.net/qq873113580/article/details/20390149using
System;using System.Collections.Generic;using Microsoft.SharePoint;usin...
分类:
其他好文 时间:
2014-06-11 12:46:01
阅读次数:
281
原题地址:https://oj.leetcode.com/problems/powx-n/题意:Implement
pow(x,n).解题思路:求幂函数的实现。使用递归,类似于二分的思路,解法来自Mark Allen Weiss的《数据结构与算法分析》。代码:class
Solution: #...
分类:
编程语言 时间:
2014-06-11 08:59:33
阅读次数:
317
Although apply and call can implement same
function. However, there is a litter different between them.Please pay attention
to look at the examples be...
分类:
移动开发 时间:
2014-06-07 21:53:15
阅读次数:
331
最近项目需要用到上传下载,以前学jsp的时候直接用的是smartUpload,现在学的框架但是老师只是简单地教了框架的内容
对struts文件上传和下载没有涉及,没办法只能自己自学了!结果出现了上面的问题。
这个问题的根本原因网上都有说出来,但是没有给出的解决方案。原因是要返回的流为空,文件的路径有误导致文件的输入流为空!
所以最好在逻辑处理那块输出的你要下载文件的路径看是不是你要下载的路径...
分类:
编程语言 时间:
2014-06-07 13:15:51
阅读次数:
289
Implement atoi to convert a string to an integer.
Hint: Carefully consider all possible input cases. If you want a challenge, please do not see below and ask yourself what are the possible input ca...
分类:
其他好文 时间:
2014-06-07 12:21:30
阅读次数:
284
题目链接Implement next permutation, which rearranges
numbers into the lexicographically next greater permutation of numbers.If such
arrangement is not pos...
分类:
其他好文 时间:
2014-06-07 11:10:30
阅读次数:
212