摘要:
1 public static List<int> BinaryTreeInorderTraveral(BTNode root) 2 { 3 List<int> ret = new List<int>(); 4 BinaryTreeInorderTraveralHelper(root, ret); 5 return ret; 6 } 7 8 public static void BinaryTreeInorderTraveralHelper(BTNode ... 阅读全文
摘要:
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 of the two subtrees ofeverynode never differ by more than 1. 1 public static bool BalancedBinaryTree(BTNode root) 2 { 3 i... 阅读全文