摘要: Given a singly linked list where elements are sorted in ascending order, convert it to a height balanced BST. 阅读全文
posted @ 2016-05-20 22:58 Adding 阅读(119) 评论(0) 推荐(0) 编辑
摘要: Given a binary tree and a sum, determine if the tree has a root-to-leaf path such that adding up all the values along the path equals the given sum. F 阅读全文
posted @ 2016-05-20 11:33 Adding 阅读(163) 评论(0) 推荐(0) 编辑
摘要: class TreeNode { int val; TreeNode left; TreeNode right; TreeNode(int x) { val = x; } } public class Solution { public boolean isBalanced(TreeNode root) { if(root==nu... 阅读全文
posted @ 2016-05-20 09:47 Adding 阅读(533) 评论(0) 推荐(0) 编辑