上一页 1 ··· 28 29 30 31 32 33 34 35 36 ··· 40 下一页
摘要: 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... 阅读全文
posted @ 2015-07-28 16:11 amazingzoe 阅读(104) 评论(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-07-28 13:29 amazingzoe 阅读(159) 评论(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-07-28 13:07 amazingzoe 阅读(126) 评论(0) 推荐(0)
摘要: Two elements of a binary search tree (BST) are swapped by mistake.Recover the tree without changing its structure.Note:A solution using O(n) space is ... 阅读全文
posted @ 2015-07-28 12:54 amazingzoe 阅读(153) 评论(0) 推荐(0)
摘要: Given a binary tree, return thezigzag level ordertraversal of its nodes' values. (ie, from left to right, then right to left for the next level and al... 阅读全文
posted @ 2015-07-28 10:41 amazingzoe 阅读(183) 评论(0) 推荐(0)
摘要: Given a binary tree, return thebottom-up level ordertraversal of its nodes' values. (ie, from left to right, level by level from leaf to root).For exa... 阅读全文
posted @ 2015-07-27 22:34 amazingzoe 阅读(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 @ 2015-07-27 22:00 amazingzoe 阅读(216) 评论(0) 推荐(0)
摘要: Given a binary tree, return thepostordertraversal of its nodes' values.For example:Given binary tree{1,#,2,3}, 1 \ 2 / 3return[3,2,1].No... 阅读全文
posted @ 2015-07-27 16:17 amazingzoe 阅读(148) 评论(0) 推荐(0)
摘要: Given a binary tree, return theinordertraversal of its nodes' values.For example:Given binary tree{1,#,2,3}, 1 \ 2 / 3return[1,3,2].Note... 阅读全文
posted @ 2015-07-27 13:25 amazingzoe 阅读(131) 评论(0) 推荐(0)
摘要: Given a binary tree, return thepreordertraversal of its nodes' values.For example:Given binary tree{1,#,2,3}, 1 \ 2 / 3return[1,2,3].Not... 阅读全文
posted @ 2015-07-27 12:05 amazingzoe 阅读(128) 评论(0) 推荐(0)
上一页 1 ··· 28 29 30 31 32 33 34 35 36 ··· 40 下一页