Google Interview Question

Find some metric in an arbitrary tree