摘要:
普通二叉树 BST平衡二叉树 阅读全文
摘要:
private boolean isBalanced = true; public boolean IsBalanced_Solution(TreeNode root) { height(root); return isBalanced; } public int height(TreeNode root) { ... 阅读全文
摘要:
class TreeNode { int val = 0; TreeNode left = null; TreeNode right = null; public TreeNode(int val) { this.val = val; } } public class Solution { public int Tree... 阅读全文
摘要:
/** * Definition for a binary tree node. * public class TreeNode { * int val; * TreeNode left; * TreeNode right; * TreeNode(int x) { val = x; } * } */ class Solution { i... 阅读全文
摘要:
序列化二叉树 59ms 阅读全文
摘要:
/*输入一棵二叉搜索树,将该二叉搜索树转换成一个排序的双向链表。要求不能创建任何新的结点,只能调整树中结点指针的指向。 */ class TreeNode { int val = 0; TreeNode left = null; TreeNode right = null; public TreeNode(int val) { this.va... 阅读全文