Tree的traverse,Preorder, Inorder, Postorder ,这些都是用stack来模拟考察的比较多。参考这里: PreOrder, InOrder, PostOrder 题型总结 这里主要总结,divide and conquer 逻辑,往上返回result的情况; Lowest Common Ancestor of a Binary Search Tree 思路
http://acm.hdu.edu.cn/showproblem.php?pid=5050 Divided Land Time Limit: 8000/4000 MS (Java/Others) Memory Limit: 65536/65536 K (Java/Others)Total Submission(s): 713 Accepted Submission(s): 339