Diameter of Binary Tree
The goal is to find the length of the longest path between any two nodes in a binary tree.
The goal is to find the length of the longest path between any two nodes in a binary tree.
Find the lowest common ancestor (LCA) of two given nodes, `p` and `q`, in a Binary Search Tree (BST).
Find the deepest node shared by two given nodes in a binary tree.
Given the root of a binary tree, determine the maximum depth.