Dijkstra's algorithm

here it was used *(s.begin()) to traverse the set of ( node and the distance). But why * was used and what would be the output if * was not included

s.begin() is an iterator pointing to first element. To access the element you have to use * . Without it the element cannot be accessed.

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.