nodepath function

Path of a terminal node