Lowest Common Ancestor of a Binary Tree 3 - Given Parent Pointer
Problem Given values of two nodes in a Binary Tree p and q, find the Lowest Common Ancestor (LCA). It may be assumed that both nodes exist in the tree and Node has parent pointer. class Node { public int val; public Node left; public Node right; public Node parent; } ...