Insert a value into a binary search tree.
Search for a value in a BST. Return the node or None.
Find the height of a binary tree.
Return the inorder traversal of a binary tree as a list.
Return the preorder traversal of a binary tree as a list.
Check if a binary tree is a valid binary search tree.
Find the LCA of two nodes in a binary tree.
Find the diameter (longest path between any two nodes).
Serialize a binary tree to a string and reconstruct it.
Is there a root-to-leaf path that sums to a target?
Check if a binary tree is its own mirror image.
Find the diameter (longest path between any two nodes) of a binary tree.