Lecture 95: Dijkstra's Algorithm || C++ Placement Series

  Рет қаралды 158,738

CodeHelp - by Babbar

CodeHelp - by Babbar

Күн бұрын

Пікірлер: 239
@__k.abhishek
@__k.abhishek 2 жыл бұрын
Aapke samne 20, 000 wale courses bhi fail hai 🚀🚀. Lovely to have such mentor..
@vishalgarna4580
@vishalgarna4580 Жыл бұрын
Babbar bhaiya ko great thanks to explain in detail ❤❤
@shalinisaini3787
@shalinisaini3787 13 күн бұрын
Thank you for this amazing course
@kashishjain8133
@kashishjain8133 2 жыл бұрын
Thanku bhaiya for such a great series. Consistency++ Josh++
@PKMKB93000
@PKMKB93000 2 жыл бұрын
Bro how many days it took you to complete all video lectures till this video?
@soumikmondalofficial
@soumikmondalofficial 2 жыл бұрын
@@PKMKB93000 5 days
@PKMKB93000
@PKMKB93000 2 жыл бұрын
@@soumikmondalofficial impossible
@soumikmondalofficial
@soumikmondalofficial 2 жыл бұрын
@@PKMKB93000 I am just talking about graph series. This is no.10 video 🙂
@PKMKB93000
@PKMKB93000 2 жыл бұрын
@@soumikmondalofficial oh 🤣
@Ybash2979
@Ybash2979 6 ай бұрын
More power to you bro itna time dedicate krne ke baad bhi itni bdia explanation chuma ekdum
@anupamtiwary4265
@anupamtiwary4265 5 ай бұрын
It felt bad when he said "iss video ke sponsors nahi hai" with a smile.
@sarthaktyagi1077
@sarthaktyagi1077 2 жыл бұрын
Perfect Topic considering today's leetcode question of the day.
@alexrcrew1975
@alexrcrew1975 2 жыл бұрын
yeah u r riight
@dhanjeekumar1906
@dhanjeekumar1906 19 күн бұрын
Thank you so much bhaiya for such great DSA cotent Energy++ , cosistency++
@pramantomar822
@pramantomar822 2 жыл бұрын
Bhaiya negative comments ko plz ignore karna u r the best and we are always with you Most importantly take care of your health ❣️❣️❣️❣️❣️
@amitsarje9428
@amitsarje9428 2 жыл бұрын
Hi Love bhaiya. Your channel has helped me a lot to prepare for DS algo questions , thanks a lot ! Thanks to Lakshay bhaiya for the awesome OS series !
@Ayush_.
@Ayush_. 2 жыл бұрын
bhai DSA kaha se kiya thaa & Question practice kaha se kii thi ??? CP bhi ki thi kya
@sachinupreti7159
@sachinupreti7159 Жыл бұрын
@@Ayush_. without CP ? AMAZON ? you have got to be kidding with us ? even TCS digital requires CP. then it's AMAZON
@Ayush_.
@Ayush_. Жыл бұрын
@@sachinupreti7159 There is No need of DP if you are good in DSA
@TuringTested01
@TuringTested01 Жыл бұрын
​@@sachinupreti7159 konsa alcohol drink karrhe ho ajkal? send link
@usernamewhatsoever4557
@usernamewhatsoever4557 Жыл бұрын
bro apne leetcode gfg and codestudio profile ke links dena please
@arpitsharma7246
@arpitsharma7246 2 жыл бұрын
lage rho bhiya consistancy maintain rakhna apke jaisa teacher koi nhi
@PankajKumar-uk8uj
@PankajKumar-uk8uj Жыл бұрын
low energy ?? Redbull should make you their brand ambassador Babbar bhaiya you have the best explanation!! thank you!
@usernamewhatsoever4557
@usernamewhatsoever4557 Жыл бұрын
Din ke 4 videos kar rha hoon, july end tak dp bhi ho jayega then bas sliding window prefix sum graph coloring aur 1 2 topics bachenge thank you bhaiya placement lagi to party zarur dunga
@Aman-fz1ew
@Aman-fz1ew Жыл бұрын
4 videos good
@Anonymous____________A721
@Anonymous____________A721 7 ай бұрын
Did you get 😢
@HarshitSharma-h9o
@HarshitSharma-h9o 5 күн бұрын
@@Anonymous____________A721
@AkashSingh-ds3pd
@AkashSingh-ds3pd Жыл бұрын
Babbar bhaiya In this video-->>"Daro mat is video me sponsors nahin hain"🤣🤣🤣🤣
@gw-lol948
@gw-lol948 2 жыл бұрын
Bhaiya Apka y tutorial Bhut helpfull h😍 thanks ❤
@laxmankumawat6728
@laxmankumawat6728 2 жыл бұрын
Peche Wale me distance array samj nhi aaya tha but now is clear 👌👌💘
@TechUprise-by-Jyoti
@TechUprise-by-Jyoti 2 жыл бұрын
Consistency OP. Thank you bhaiya🙃😇
@017_indrasen9
@017_indrasen9 Жыл бұрын
4:30 daro mat iss video mein koi sponsor nahi hai 🤖
@RohitSingh-hc8yi
@RohitSingh-hc8yi Жыл бұрын
Hats off to your efforts bhaiya
@RohitSingh-hc8yi
@RohitSingh-hc8yi Жыл бұрын
loving your lectures bhaiya
@Niki_0011
@Niki_0011 8 ай бұрын
Best dsa series ❤❤
@sujeetkumar6971
@sujeetkumar6971 2 жыл бұрын
100% placement oriented learning Bhaiya keep it up....
@shekharsuman3219
@shekharsuman3219 2 жыл бұрын
Bhaiya keep inspiring us we r with u
@NihalSingh-ld2en
@NihalSingh-ld2en 2 жыл бұрын
Thanks, aj subah se ye topic ka video dhund rha tha jis se kuch smz m ae
@skchoudhary7956
@skchoudhary7956 2 жыл бұрын
Graph series...full on fire🔥🔥...Babbar bhai chahe 2-4 videos jyada lag jaye koi dikkt nhi...lekin graph ko pura depth me krenge....💪... aur bhai limit cross krne ki jarurt nhi h...aapko bhi mazaa aana chahiye😅
@parthtrivedi318
@parthtrivedi318 2 жыл бұрын
Aur kitne din chal sakta hai course
@Harry-ju9nv
@Harry-ju9nv 2 жыл бұрын
haa bhai aisa hai Dynamic programming bhi chale
@VikashKumar-cg8tj
@VikashKumar-cg8tj 9 күн бұрын
Amazing Explanation
@manikantadevadiga7146
@manikantadevadiga7146 Жыл бұрын
can anyone explain how the set works to get top by minimum distance when it has pairs?
@vasusharma3527
@vasusharma3527 Жыл бұрын
it takes the first value to compare ie the distance and set is sorted so it shows min distance always at the top
@manikantadevadiga7146
@manikantadevadiga7146 Жыл бұрын
@@vasusharma3527 tq bro❤
@tejveernaruka3287
@tejveernaruka3287 2 жыл бұрын
Thanku Babbar Bhaiya for your efforts
@BEESaiShivam
@BEESaiShivam Жыл бұрын
why cant we do it using method used in last video?
@rachit_joshi
@rachit_joshi 5 ай бұрын
Thank You So Much BHRATA SHREE !!!!!!!
@KhushiKavya-py1yj
@KhushiKavya-py1yj 3 ай бұрын
placement season has started and bs 45 vdos left and i am not able to be consistent , next 2 months placement will take place
@malikaamalhotra8397
@malikaamalhotra8397 Жыл бұрын
consistency++, thankyou bhaiya
@tiwaritejaswo
@tiwaritejaswo 2 жыл бұрын
Why do we have to process the nodes in a sorted order by distance (using minHeap/set)? I tried doing it using BFS (normal queue) and it's passing all the test cases. please clear the doubt.
@rahulrawal6542
@rahulrawal6542 2 жыл бұрын
cuz we are updating distance every time so I guess there is no effect of taking nodes in sorted order by distance
@salmankhader1258
@salmankhader1258 Жыл бұрын
@@rahulrawal6542 No thats wrong i tried doing this using normal queue and i was getting wrong answer
@AmanSinghRawat-ug6fr
@AmanSinghRawat-ug6fr 10 ай бұрын
Brother because priority queue or set reduce the time complexity by vlogv . If you use queue time complexity will be nxn
@rajsharma-bd3sl
@rajsharma-bd3sl 7 ай бұрын
Why time complexity O(E logV ) and not ((V+E)logV) ?
@jaipreetkaur9658
@jaipreetkaur9658 2 жыл бұрын
Love bhaiya both sett video !! Bs ye record wala smjh nhi aya
@dishantkumar6723
@dishantkumar6723 2 жыл бұрын
are more videos coming in this free course?
@alexrcrew1975
@alexrcrew1975 2 жыл бұрын
definityely
@samsmith3961
@samsmith3961 2 жыл бұрын
a wise man once said,"daro mat iss video mein koi sponsor nhi hai!!"
@barnikroy5244
@barnikroy5244 2 жыл бұрын
Only sher of youtube in computer domain
@aaravsingh4571
@aaravsingh4571 2 жыл бұрын
Bhaiya github me bache hue video ke code daal do, and agar possible ho to bache hue video ke handwritten notes bhi daal do please
@iteself_me
@iteself_me Жыл бұрын
190 ✅completed 👍Liked 04:39
@pkk5124
@pkk5124 2 жыл бұрын
Why is it that when i am using map to store dist-index i am getting wrong answer for only one value in a testcase,like for 17 nodes I am getting correct only in 16 nodes and rest all testcases are correct but only this value is wrong.Can some one point out the differnce when using map vs set. They both store elements in sorted order so where am I wrong??
@dhananjaysharma9020
@dhananjaysharma9020 2 жыл бұрын
set is ordered but if you use map it will be unordered
@dEviL_bIsWaJiT
@dEviL_bIsWaJiT 2 жыл бұрын
Present bhaiya 🔥
@AliShair-f7q
@AliShair-f7q 5 ай бұрын
can someone expliain why we are using set? why we need to select node with less distance in the set
@simranbandhu9926
@simranbandhu9926 2 жыл бұрын
why do we have to pick minimum value only ? what is the use of set here
@NiyatiOffice
@NiyatiOffice 3 ай бұрын
set is always ordered in case of cpp, so the top will always contain min distance
@chandrabhanbahetwar9638
@chandrabhanbahetwar9638 2 жыл бұрын
Can anyone tell me why we are picking smaller distance value first ?
@alexrcrew1975
@alexrcrew1975 2 жыл бұрын
anyone explain the how min pair is always picked up from set up as he told that we have to pick piar based on min distance everytime but we haven't write any logic for that here
@ADITYAKUMAR-tb4gm
@ADITYAKUMAR-tb4gm 2 жыл бұрын
property of set , it stores data in sorted order by default
@alexrcrew1975
@alexrcrew1975 2 жыл бұрын
@@ADITYAKUMAR-tb4gm ok got it
@SumitSharma-ui7wx
@SumitSharma-ui7wx Жыл бұрын
Why do we have to pick node with minimum distance, when values in distance array are overwritten whenever smaller distance is found? Can anybody explain?
@rajeshchaurasiya9
@rajeshchaurasiya9 Жыл бұрын
so that we don't get stuck in updating one node multiple node. Plus by choosing min distance first, we get the chance to reach our destination node early. plus by choosing min weight first, we have to update distances less times.
@mkat21
@mkat21 Жыл бұрын
daro mat iss video mai koi sponsers ni h ..got me laughing hard. as i was expecting them as an habit.
@kritikarawat2180
@kritikarawat2180 Жыл бұрын
The explaination today was not that best saw striver's 3 videos to understand this whole algorithm but was worth it.But kudos to your efforts always.This was just a feedback i am following whole series.
@BEESaiShivam
@BEESaiShivam Жыл бұрын
uhm...beside love babbar bhaiya,what are the alternatives to watch for?
@bachaankasongs8562
@bachaankasongs8562 2 жыл бұрын
Sir main new subscriber hun mujhe pata chala hai ki aap ke chennal par laptops ka giveaway hota hai and mujhe bhi ek laptop chahiya toh next giveaway kab hai
@bat_man1138
@bat_man1138 2 жыл бұрын
Sir i think this is bit different algo from dijkstra algo..all the test cases are passing.but this is not dijkstra.. IN dijkstra we mark the vertex as PROCESSED once it is processed . No such discussions here..this algo works but it is not dijkstra Can anyone clarify please🙏 It will be great help
@Mohit-im4kx
@Mohit-im4kx 2 жыл бұрын
we always process min distance node which is done by set and once processed we move forward also handled by set (deleting min) and once all are processed is equivalent to set being empty
@anuragpandey8165
@anuragpandey8165 2 жыл бұрын
consistency--
@satyamdwivedi8135
@satyamdwivedi8135 2 жыл бұрын
Bhaiya Next video? Agar fever hai toh take rest we will wait….get well soon.
@raoshnakquadri8731
@raoshnakquadri8731 2 жыл бұрын
Bhaiya code from graphs are not there in github repo. Please do push the codes in github repo.
@WIN_1306
@WIN_1306 4 ай бұрын
please someone tell the video number at which sir taught SET
@dudamneerajdattu1459
@dudamneerajdattu1459 Ай бұрын
isn't T.C O((V + E)logV)?
@mubashirkhan6178
@mubashirkhan6178 2 жыл бұрын
Brother kindly object oriented programming or design pattern ke videos playlist banao.
@Ybash2979
@Ybash2979 6 ай бұрын
bhai please ye waale code dedo or upload krdo , i have your paid course also but pta nhi idhar zaada smj aa rh
@harshpandey4190
@harshpandey4190 Жыл бұрын
I was About to skip when you said " daro mat iss video me koi sponsor nahi hai "
@RohitSingh-hc8yi
@RohitSingh-hc8yi Жыл бұрын
quite a good series
@jhordd52
@jhordd52 2 жыл бұрын
Consistency ++ bhaiya well done
@vortexdeo4545
@vortexdeo4545 2 жыл бұрын
Prevent Burnout ☠💯
@vcbstandby4388
@vcbstandby4388 2 жыл бұрын
wonderful explaination sir
@amishapandey6875
@amishapandey6875 Жыл бұрын
Thankyou Bhaiya!!!
@adityaraj-zm7zk
@adityaraj-zm7zk 2 жыл бұрын
auto top = *(st.begin( )); means
@gunjansaxena9760
@gunjansaxena9760 Жыл бұрын
iterator ko dereference kr rhe
@alokranjan3185
@alokranjan3185 2 жыл бұрын
great explanation bhiaya
@yashsharma3083
@yashsharma3083 2 жыл бұрын
Sir in Notes link only notes till lecture 40 are provided where can we find rest??
@rajeshchaurasiya9
@rajeshchaurasiya9 Жыл бұрын
one thing that was not mentioned or i might have missed: dijkstra's algo doesn't work when there are edges with negative weights.
@Singh_Sahdev
@Singh_Sahdev 11 ай бұрын
That's why bellman ford's algo come in existence
@funfactff3167
@funfactff3167 8 ай бұрын
But I guess if we will use this code then it will work fine for even negative edges. As we are updating the distance array and again inserting it into the set. By doing so we are again checking for the minimum distance for every nodes. May be I have misunderstood, please correct me if I am wrong.
@funfactff3167
@funfactff3167 8 ай бұрын
​@@Singh_SahdevBut I guess if we will use this code then it will work fine for even negative edges. As we are updating the distance array and again inserting it into the set. By doing so we are again checking for the minimum distance for every nodes. May be I have misunderstood, please correct me if I am wrong.
@YizenOdyuo
@YizenOdyuo 5 ай бұрын
​@@funfactff3167 in Dijkstra algorithm once we visit a node and update distance we don't revisit that node. This is where the algorithm doesn't work for negative edges
@UdayKumar-gu2sg
@UdayKumar-gu2sg 2 жыл бұрын
Bhaiyya please written notes update kardo bhaiya
@alexrcrew1975
@alexrcrew1975 Жыл бұрын
Why negative weights fails for dijkstra algo? Anyone please explain with help of this code
@muhammadsuleman8936
@muhammadsuleman8936 Жыл бұрын
have you found answer?
@honestad3558
@honestad3558 8 ай бұрын
​​@@muhammadsuleman8936 Ab Tak to dono ko jawab milgya hoga lekin nhi Mila to mei bata deta ho negative distance har instant pe distance aur negative kartey jagey mtlb aur chota kartey jageye mtlb infnite loop mei fass jayenge
@honestad3558
@honestad3558 8 ай бұрын
Ab Tak to dono ko jawab milgya hoga lekin nhi Mila to mei bata deta ho negative distance har instant pe distance aur negative kartey jagey mtlb aur chota kartey jageye mtlb
@muhammadsuleman8936
@muhammadsuleman8936 8 ай бұрын
@@honestad3558 BRO thanks for your reply.. But abhi to ma ya b bhool gaya ho ka question pocha q tha LOL... Have a nice coding journey.🙂
@PritamDas-jj1uo
@PritamDas-jj1uo 2 жыл бұрын
After finding the minmum distance to a node from the source , it's not marked either the node is visited or not in the mentioned algo.I
@TuringTested01
@TuringTested01 Жыл бұрын
it doesnt need to be, because all the edges are positive weights so there is no way to travel back because distance travelled so far will be postive as well as distance to travel will also be postive
@niharbastia5740
@niharbastia5740 2 жыл бұрын
Keep going Bhaiya !!
@shubhamkumarsingh8818
@shubhamkumarsingh8818 2 жыл бұрын
bhaiya aur videos kab daal rahe ho???
@vmstudy9965
@vmstudy9965 5 ай бұрын
Swaad ++...🎉
@itskaaryan7
@itskaaryan7 Жыл бұрын
while creating the adjacency list why did we run the for loop till vertices and not the edges, bcoz in previous all vidoes i have seen we were doing till edges size. can anybody please clearify my doubt. Thanks
@rajeshchaurasiya9
@rajeshchaurasiya9 Жыл бұрын
that is a mistake. finish video.
@anushkachaudhary3501
@anushkachaudhary3501 4 ай бұрын
❤ best
@Tan-mb2nd
@Tan-mb2nd 4 ай бұрын
great video
@thebigexperiment1666
@thebigexperiment1666 2 жыл бұрын
Very helpfull
@amantarar9077
@amantarar9077 2 жыл бұрын
Consistency op ❤️❤️
@GANESHSINGH-uc1gk
@GANESHSINGH-uc1gk 2 жыл бұрын
amazing bhaiya!!!
@RohitSingh-hc8yi
@RohitSingh-hc8yi Жыл бұрын
thanks a lot
@sarthak-salunke
@sarthak-salunke 2 жыл бұрын
Keep ti up sir ❤️❤️
@KACodes
@KACodes 2 жыл бұрын
Bhai back in form....🤩🤩
@DeepanshChawla_
@DeepanshChawla_ 2 жыл бұрын
Bhaiyaa Thankyouuu 🔥
@GyanworkHindi
@GyanworkHindi 2 жыл бұрын
Sir pleas please yeh course complete karna ..
@jaydwarkadhish959
@jaydwarkadhish959 2 жыл бұрын
Very nice sir
@manavrollno.2314
@manavrollno.2314 2 жыл бұрын
Bhaiya thankyou ❤️🔥
@tanishk1059
@tanishk1059 2 жыл бұрын
Thank you bhaiya 🙏🙏... sab samaj aa gya
@PKMKB93000
@PKMKB93000 2 жыл бұрын
Bro how many days it took you to complete all video lectures till this video?
@tanishk1059
@tanishk1059 2 жыл бұрын
Around 40 days
@PKMKB93000
@PKMKB93000 2 жыл бұрын
@@tanishk1059 okay thanks for replying
@nishankdeep3084
@nishankdeep3084 2 жыл бұрын
thank you bhaiya
@gw-lol948
@gw-lol948 2 жыл бұрын
Bhaiya Apptitude strong kerne k koi jhugad Btayiye🥲
@kshitijraj1320
@kshitijraj1320 2 жыл бұрын
Thank you bhaiya ❤
@BhaiRayyanKiDuniya
@BhaiRayyanKiDuniya 2 жыл бұрын
Bhaiya yaar sponsors shoutout bhejte raho
@fazerugbrug439
@fazerugbrug439 2 жыл бұрын
brilliant
@bossmemes3308
@bossmemes3308 Жыл бұрын
Is it mandatory to remove the previous inserted value, I haven't do that but my program is running well.
@gunjansaxena9760
@gunjansaxena9760 Жыл бұрын
it increases the time complexity a little bit thats all
@lonerider6695
@lonerider6695 11 ай бұрын
​@@gunjansaxena9760can anyone explain why we are selecting min.distance node from the set because if we take another node then also latter the distance would be updated to min only please tell
@anuragpandey8165
@anuragpandey8165 2 жыл бұрын
daalo yrr videos baki ki
@yashasvic2429
@yashasvic2429 Жыл бұрын
Thanks Bhai 👍
@eshaanbagga5159
@eshaanbagga5159 Жыл бұрын
I don't think removing the already present is necessary. Correct me if I am wrong.
@meme_eternity
@meme_eternity 2 жыл бұрын
can't be there a path from 0 to 0 less than 0 as there may be negative weights also in the graph and they sum up to negative making that path the shortest path?
@neerajkhatri9398
@neerajkhatri9398 Жыл бұрын
This is the reason why Dijkstra's Algorithm fails when we have negative weights.
@muhammadsuleman8936
@muhammadsuleman8936 Жыл бұрын
can you explain this plz ? how it fails on negative weights?@@neerajkhatri9398
@godwalker8617
@godwalker8617 2 жыл бұрын
bhaiya the course is good but bohot lengthy h itna flow bnn hi nhi paa rha h 1 mahine se krr rha hu sirf 35 vedios hui h plzz isko thoda compress krdo bss basics clear krne k liye taki questions krr ske but love the content !!!!!!!
@PKMKB93000
@PKMKB93000 2 жыл бұрын
Bhai how many videos do you cover in 1 day and how much time did you dedicated to it?
@PKMKB93000
@PKMKB93000 2 жыл бұрын
@@V418H4V Ha jabhi me CWH chodh ke is playlist pe aya.
@koitohu5661
@koitohu5661 2 жыл бұрын
@@V418H4V bro ye enough h kya course I am in service company aur mujhe DSA krni h. Love babber ki playlist enough h kya kya DSA aa jaayengi isse
@thebigexperiment1666
@thebigexperiment1666 2 жыл бұрын
Great sir
Lecture 96: Minimum Spanning Tree || Prim's Algorithm
33:04
CodeHelp - by Babbar
Рет қаралды 146 М.
Perfect Pitch Challenge? Easy! 🎤😎| Free Fire Official
00:13
Garena Free Fire Global
Рет қаралды 100 МЛН
How Many Balloons To Make A Store Fly?
00:22
MrBeast
Рет қаралды 92 МЛН
This Game Is Wild...
00:19
MrBeast
Рет қаралды 152 МЛН
3.6 Dijkstra Algorithm - Single Source Shortest Path - Greedy Method
18:35
Lecture 101: Bellman Ford Algorithm || C++ Placement Series
22:06
CodeHelp - by Babbar
Рет қаралды 68 М.
Dijkstra's Algorithm - Computerphile
10:43
Computerphile
Рет қаралды 1,3 МЛН
DSA & ₹1.2 Crore Per Annum Jobs - The Truth? (No Offence)
12:22
CodeWithHarry
Рет қаралды 712 М.
This Algorithm is 1,606,240% FASTER
13:31
ThePrimeagen
Рет қаралды 852 М.
New divisibility rule! (30,000 of them)
26:51
Stand-up Maths
Рет қаралды 275 М.
How Dijkstra's Algorithm Works
8:31
Spanning Tree
Рет қаралды 1,4 МЛН
L-4.10: Dijkstra's Algorithm - Single Source Shortest Path - Greedy Method
15:49
Perfect Pitch Challenge? Easy! 🎤😎| Free Fire Official
00:13
Garena Free Fire Global
Рет қаралды 100 МЛН