1. Balanced Binary Treehistorical

    Given a binary tree, determine whether it is a balanced binary tree.

  2. Lowest Common Ancestor of a Binary Treehistorical

    Given a binary tree, find the lowest common ancestor of two specified nodes in the tree.

  3. Mirror of a Binary Treehistorical

    Transform a binary tree into its mirror by swapping the left and right subtrees at every node.

  4. Diameter of Binary Treehistorical

    Given a binary tree, calculate its diameter. The diameter of a binary tree is the maximum path length between any two nodes. This path may or may not pass through the root.

  5. Print a Binary Tree in Multiple Lineshistorical

    Print a binary tree level by level from top to bottom, with nodes on the same level output from left to right. Output each level on a separate line.

  6. Lowest Common Ancestor Nodehistorical

    Given a binary tree and two nodes o1 and o2 in the tree, find their lowest common ancestor.

  7. Print a Binary Tree in Zigzag Orderhistorical

    Implement a function that prints a binary tree in zigzag order: the first row from left to right, the second level from right to left, the third row from left to right, and so on.

  8. Merge Two Binary Treeshistorical

    Merge two binary trees by adding the values of overlapping nodes and retaining nodes that do not overlap.

  9. Substructure of a Treehistorical

    Given two binary trees A and B, determine whether B is a substructure of A. (ps: an empty tree is not considered a substructure of any tree.).

  10. Symmetric Treehistorical

    Given a binary tree, check whether it is mirror-symmetric.