Add parent node id and child index to preorder iterator.