Sophos Interview Question

Write program for finding depth of tree