摘要: Given a non-negative number represented as an array of digits, plus one to the number.The digits are stored such that the most significant digit is at the head of the list.思路:这道题就是一个大数加法。从右往左,最低位加上1,然后判断result[n-1]是不是大于9,即取其除数向前进位。class Solution {public: vector plusOne(vector &digits) { ve... 阅读全文
posted @ 2014-03-25 16:48 Awy 阅读(152) 评论(0) 推荐(0) 编辑
摘要: Given a binary tree, return thepostordertraversal of its nodes' values.For example:Given binary tree{1,#,2,3}, 1 \ 2 / 3return[3,2,1].No... 阅读全文
posted @ 2014-03-25 11:59 Awy 阅读(193) 评论(0) 推荐(0) 编辑