Whats the need to maintain parent map?

whats the use of storing parent of node here?

@mayankA47 Parent map is required when you want to print the shortest path after all the traversing. You will start from the destination node and move to its parent. Again you will move to the parent of this node and this way you will reach the source node by checking the parent map.

yes i agree, for snakes and ladders its required