def depth(n, tree):
d = <NUM_LIT:0><EOL>parent = tree[n]<EOL>while parent is not None:<EOL><INDENT>d += <NUM_LIT:1><EOL>parent = tree[parent]<EOL><DEDENT>return d<EOL>
get depth of an element in the tree