During the second interview, I was asked to implement LCA in a binary tree (not BST) on collabedit.com. I was close, but not close enough...
Sigiloso
class Node { int value; int height Node next; Node right; Node parent; } public int height(Node root) { int retValue = 0; while((root=parent(root)) != NULL) { retValue+ } return retValue; } public Node LCA(Node A, Node B) { Node temp; A.height = height(A); B.height = height(B); if(A.height B.height; i--, A=parent(A)); do { A = parent(A); B = parent(B); } while (A != B); return A; }