I\'ve got the following code to find the lowest common ancestor (the lowest node that has both a and b as descendants):
public static Node LCA(Node root, Node a,
public static Node LCA(Node root, Node a, Node b) { if (root == null) return null; if (root.IData > a.IData && root.IData > b.IData) return LCA(root.LeftChild, a, b); if (root.IData < a.IData && root.IData < b.IData) return LCA(root.RightChild, a, b); return root; }