上一页 1 ··· 13 14 15 16 17 18 19 20 21 ··· 28 下一页
摘要: Given an array where elements are sorted in ascending order, convert it to a height balanced BST.解题思路:首先要理解,什么叫做height balanced BST Java for LeetCode ... 阅读全文
posted @ 2015-05-23 19:42 TonyLuis 阅读(221) 评论(0) 推荐(0) 编辑
摘要: Given a binary tree, return the bottom-up level order traversal of its nodes' values. (ie, from left to right, level by level from leaf to root). For ... 阅读全文
posted @ 2015-05-23 18:19 TonyLuis 阅读(227) 评论(0) 推荐(0) 编辑
摘要: Construct Binary Tree from Inorder and Postorder TraversalTotal Accepted: 31041 Total Submissions: 115870Given inorder and postorder traversal of a tr... 阅读全文
posted @ 2015-05-23 18:16 TonyLuis 阅读(190) 评论(0) 推荐(0) 编辑
摘要: Given preorder and inorder traversal of a tree, construct the binary tree.Note:You may assume that duplicates do not exist in the tree.解题思路一:preorder[... 阅读全文
posted @ 2015-05-23 10:49 TonyLuis 阅读(179) 评论(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 farthest le... 阅读全文
posted @ 2015-05-23 09:37 TonyLuis 阅读(128) 评论(0) 推荐(0) 编辑
摘要: Given a binary tree, return the zigzag level order traversal of its nodes' values. (ie, from left to right, then right to left for the next level and ... 阅读全文
posted @ 2015-05-23 09:32 TonyLuis 阅读(179) 评论(0) 推荐(0) 编辑
摘要: Given a binary tree, return the level order traversal of its nodes' values. (ie, from left to right, level by level). For example:Given binary tree {3... 阅读全文
posted @ 2015-05-23 09:26 TonyLuis 阅读(1403) 评论(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 @ 2015-05-22 00:52 TonyLuis 阅读(171) 评论(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 identical an... 阅读全文
posted @ 2015-05-22 00:22 TonyLuis 阅读(172) 评论(0) 推荐(0) 编辑
摘要: Two elements of a binary search tree (BST) are swapped by mistake.Recover the tree without changing its structure.解题思路:先中序遍历找到mistake,然后替换即可,JAVA实现如下:... 阅读全文
posted @ 2015-05-22 00:09 TonyLuis 阅读(150) 评论(0) 推荐(0) 编辑
上一页 1 ··· 13 14 15 16 17 18 19 20 21 ··· 28 下一页