Dijkstras Graph Getting wrong sequence

please mode my code

you dijstras part is correct but why did you apply bfs after that also
you are not printing in correct way also you are not considering isolated nodes as it is mentioned that you have to print a single line consisting N-1 space separated integers denoting the shortest distance of N-1 nodes other than from starting position S in increasing order of their labels

isolated nodes means that nodes that don’t have any edge so your adjacency list won’t have these nodes as keys

refer this code for more clarity

In case of any doubt feel free to ask :slight_smile:
mark your doubt as resolved if you got the answer