摘要: https://leetcode.com/problems/lowest-common-ancestor-of-a-binary-search-tree/由于是二叉排序树,所以可以先确定一个搜索函数,方便构造出一个数组用于存放搜寻路径之后再搜索路径中查找到最后重复的节点即可。 1 /** 2 * ... 阅读全文
posted @ 2015-07-12 16:01 阿怪123 阅读(113) 评论(0) 推荐(0)
摘要: https://leetcode.com/problems/climbing-stairs/ 1 class Solution { 2 public: 3 int climbStairs(int n) { 4 if(n==1) 5 return 1; ... 阅读全文
posted @ 2015-07-12 15:57 阿怪123 阅读(129) 评论(0) 推荐(0)