Pergunta de entrevista da empresa Accenture

I was asked to implement a function to check for balanced parentheses (classic stack problem) and a second, harder one involving finding the lowest common ancestor in a binary tree.