DIJKSTRA ALGORITHM

https://ide.codingblocks.com/s/449983,
BHAIYA EK BAAR MERA CODE CHECK KARNA,

AGAR HAMEY SOURCE SE DESTINATION KA PATH BHI PRINT KRANA HO TO KESE KAENGE?

hello @CODER_JATIN

parent array bana lo jaise baakio problems me kiya hai.

aur phir u array ki help se path print karo.

code me kya issue aa raha hai?

code to sahi chal rha hai , lekin ye path wali baat ni smjh aari

jaise maan lo tum current delhi pe aur.
aur delhi se amritsar jaane ka cost pehle cost se kam hai,
to hum kya kar rahe hai , amritsar ki purani cost hata ke , updated code daal rahe hai haina?

to ab ek ektra map bana lo aur jab jab update ho tab tab parent bhi update karna.

jaise ki abhi ke case me amristar pe hum delhi ke through aa rahe hai to
parent[amristar]=delhi
karlo.

thik hai matlan har ek node ke liye uska parent update krta rhu?

or jab print karana hoga path, tab to hamey ek particular src or dest chahiye na , tbhi to print krayenge?

ha …
path to do node ke bich hi batayenge na

mai ek baar try krke code bhejta hu aapko , fir btana

ide.codingblocks.com/s/449983,

dekho bhaiya ab ?

sahi to hai . . . . . . .

tareeka sahi hai ya kuch or better?

ek min rukooo ,kuch galti hai . . . .

AB DEKHO.

thik hai bhaiya , vese usme kya dikkat thi pehle wale mai?

usme tum jitni baar bhi node ko update kar rahe the, utni baar us node ke parent ko puch kar rahe the.

to matlab ki agar 3 baar updated hoga to tumhare node ke 3 parent ho jayenge.
jabki parent to ek hi hona chaiya, jiske throgh hamne last update kiya hai.
isilye map of vector na use kar ke map of string liya.

thik hai bhaiya , :slight_smile:
Dhanyawaad :slight_smile:

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.