摘要: Given an unsorted array of integers, find the length of the longest consecutive elements sequence.For example,Given[100, 4, 200, 1, 3, 2],The longest ... 阅读全文
posted @ 2014-03-08 21:11 海滨银枪小霸王 阅读(129) 评论(0) 推荐(0) 编辑
摘要: Given a binary tree, return thelevel ordertraversal of its nodes' values. (ie, from left to right, level by level).For example:Given binary tree{3,9,2... 阅读全文
posted @ 2014-03-08 19:16 海滨银枪小霸王 阅读(124) 评论(0) 推荐(0) 编辑
摘要: Implement pow(x,n).第一个版本:double pow(double x, int n){ if(n==0) return 1.0; if(n0) { if(n%2==0) return pow(x, n/2) *... 阅读全文
posted @ 2014-03-08 18:18 海滨银枪小霸王 阅读(137) 评论(0) 推荐(0) 编辑
摘要: 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 rep... 阅读全文
posted @ 2014-03-08 16:33 海滨银枪小霸王 阅读(111) 评论(0) 推荐(0) 编辑