leetcode
文章平均质量分 68
xqianxin
初学者……
展开
-
一些简单math题
1.Excel Sheet Column Number 大意:A->1,B->2,...,AA->27,... 解体思路:考虑每位的权值,然后加起来 代码: class Solution { public: int titleToNumber(string s) { int n = s.size(); int weidge = 1;原创 2015-03-23 22:02:53 · 263 阅读 · 0 评论 -
reverse interger --- leetcode
Reverse digits of an integer. Example1: x = 123, return 321 Example2: x = -123, return -321 click to show spoilers. Have you thought about this? Here are some good questions to ask before c原创 2015-04-15 20:48:59 · 258 阅读 · 0 评论 -
balanced binary Tree ---leetcode
Given a binary tree, determine if it is height-balanced. For this problem, a height-balanced binary tree is defined as a binary tree in which the depth of the two subtrees of every node never diffe原创 2015-04-09 21:06:15 · 245 阅读 · 0 评论 -
Populating Next Right Pointers in Each Node --- leetcode
Given a binary tree struct TreeLinkNode { TreeLinkNode *left; TreeLinkNode *right; TreeLinkNode *next; } Populate each next pointer to point to its next right node.原创 2015-04-09 23:06:37 · 222 阅读 · 0 评论 -
Maximum Subarray 解题
Find the contiguous subarray within an array (containing at least one number) which has the largest sum. For example, given the array [−2,1,−3,4,−1,2,1,−5,4], the contiguous subarray [4,−1,2,1] ha原创 2016-04-05 22:39:37 · 216 阅读 · 0 评论