Use of making the map parent?

What is the use of making map for maintaining parent of node in this algorithm. It can be solved without it too.

@sushant19_99 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.

I hope I’ve cleared your doubt. I ask you to please rate your experience here
Your feedback is very important. It helps us improve our platform and hence provide you
the learning experience you deserve.

On the off chance, you still have some questions or not find the answers satisfactory, you may reopen
the doubt.