get_depth function

Get the depth of a node of a tree