Check if the path starting from root corresponds to a node
0 for success
-1 if the path was empty
index in the path at which the traversal failed