2019年3月20日

617. Merge Two Binary Trees(归并两棵树)

摘要: Given two binary trees and imagine that when you put one of them to cover the other, some nodes of the two trees are overlapped while the others are n 阅读全文

posted @ 2019-03-20 14:58 shaer 阅读(134) 评论(0) 推荐(0) 编辑

226. Invert Binary Tree(翻转树)

摘要: Invert a binary tree. Example: Input: Output: Trivia:This problem was inspired by this original tweet by Max Howell: 方法一:递归 时间复杂度:o(n) 空间复杂度:o(1) 阅读全文

posted @ 2019-03-20 14:38 shaer 阅读(247) 评论(0) 推荐(0) 编辑

543. Diameter of Binary Tree(两节点的最长路径)

摘要: Given a binary tree, you need to compute the length of the diameter of the tree. The diameter of a binary tree is the length of the longest path betwe 阅读全文

posted @ 2019-03-20 11:40 shaer 阅读(82) 评论(0) 推荐(0) 编辑

110. Balanced Binary Tree(平衡树)

摘要: 110. Balanced Binary Tree Easy 108994FavoriteShare 110. Balanced Binary Tree Easy 108994FavoriteShare Easy Given a binary tree, determine if it is hei 阅读全文

posted @ 2019-03-20 11:28 shaer 阅读(87) 评论(0) 推荐(0) 编辑

104. Maximum Depth of Binary Tree(树的高度)

摘要: 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 l 阅读全文

posted @ 2019-03-20 11:05 shaer 阅读(86) 评论(0) 推荐(0) 编辑

导航