摘要: 题目:Given a binary tree containing digits from0-9only, each root-to-leaf path could represent a number.An example is the root-to-leaf path1->2->3which represents the number123.Find the total sum of all root-to-leaf numbers.For example, 1 / \ 2 3The root-to-leaf path1->2represents the number1 阅读全文
posted @ 2013-12-18 15:05 月窟仙人 阅读(157) 评论(0) 推荐(0) 编辑
摘要: 题目:Given a sorted array and a target value, return the index if the target is found. If not, return the index where it would be if it were inserted in order.You may assume no duplicates in the array.Here are few examples.[1,3,5,6], 5 → 2[1,3,5,6], 2 → 1[1,3,5,6], 7 → 4[1,3,5,6], 0 → 0这个题目比较简单,也就是二分作 阅读全文
posted @ 2013-12-18 14:18 月窟仙人 阅读(147) 评论(0) 推荐(0) 编辑