上一页 1 ··· 6 7 8 9 10 11 12 13 14 ··· 18 下一页
摘要: 题目: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 d... 阅读全文
posted @ 2014-07-31 02:35 爱做饭的小莹子 阅读(2031) 评论(0) 推荐(0) 编辑
摘要: 题目:Given an array where elements are sorted in ascending order, convert it to a height balanced BST.题解:先复习下什么是二叉搜索树(引自Wikipedia):二叉查找树(Binary Search ... 阅读全文
posted @ 2014-07-31 02:28 爱做饭的小莹子 阅读(3290) 评论(0) 推荐(1) 编辑
摘要: 题目:Given a binary tree, find its minimum depth.The minimum depth is the number of nodes along the shortest path from the root node down to the neares... 阅读全文
posted @ 2014-07-31 00:47 爱做饭的小莹子 阅读(3145) 评论(0) 推荐(0) 编辑
摘要: 题目:Given a binary tree, find its maximum depth.The maximum depth is the number of nodes along the longest path from the root node down to the farthes... 阅读全文
posted @ 2014-07-31 00:25 爱做饭的小莹子 阅读(2347) 评论(0) 推荐(0) 编辑
摘要: 题目:Given a binary tree, check whether it is a mirror of itself (ie, symmetric around its center).For example, this binary tree is symmetric: 1 /... 阅读全文
posted @ 2014-07-31 00:05 爱做饭的小莹子 阅读(3196) 评论(0) 推荐(0) 编辑
摘要: 题目:Given two binary trees, write a function to check if they are equal or not.Two binary trees are considered equal if they are structurally identica... 阅读全文
posted @ 2014-07-30 23:44 爱做饭的小莹子 阅读(2419) 评论(0) 推荐(0) 编辑
摘要: 题目:Given a binary tree, return the postorder traversal of its nodes' values.For example:Given binary tree {1,#,2,3}, 1 \ 2 / 3return [3... 阅读全文
posted @ 2014-07-30 09:53 爱做饭的小莹子 阅读(1730) 评论(0) 推荐(0) 编辑
摘要: 题目:Given a binary tree, return the preorder traversal of its nodes' values.For example:Given binary tree {1,#,2,3}, 1 \ 2 / 3return [1,... 阅读全文
posted @ 2014-07-30 09:25 爱做饭的小莹子 阅读(1689) 评论(0) 推荐(0) 编辑
摘要: 题目:Given a binary tree, return the inorder traversal of its nodes' values.For example:Given binary tree {1,#,2,3}, 1 \ 2 / 3return [1,3... 阅读全文
posted @ 2014-07-30 09:24 爱做饭的小莹子 阅读(2766) 评论(0) 推荐(0) 编辑
摘要: 题目:Given two integers n and k, return all possible combinations of k numbers out of 1 ... n.For example,If n = 4 and k = 2, a solution is:[ [2,4], ... 阅读全文
posted @ 2014-07-30 09:18 爱做饭的小莹子 阅读(4440) 评论(0) 推荐(0) 编辑
上一页 1 ··· 6 7 8 9 10 11 12 13 14 ··· 18 下一页