Howtofindthefirstancestornodefromtwoleafnodesinthesamelevelinabinarytree上面显示了一个3(2?)级二叉树。我的问题是如何从二叉树中同一级别的两个叶节点中找到祖先节点?例如,(3,4)的祖先节点是1。(3,5)的祖先节点是0。(5,6)的根节点是2。如果给定两个叶子节点,如何找到它们的第一个共同祖先节点?我正在使用C。我的方法和伪代码就像intmother{}\\\\analgorithmtofindmothernodeintn1(7),n2(11);\\\\twointegerleafnodes.inta1(-1),a2(