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 !
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
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
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.
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.
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.
@@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.
@@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
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?
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.
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
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??
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
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
@@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
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
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
Aapke samne 20, 000 wale courses bhi fail hai 🚀🚀. Lovely to have such mentor..
Babbar bhaiya ko great thanks to explain in detail ❤❤
Thanku bhaiya for such a great series.
Consistency++
Josh++
Bro how many days it took you to complete all video lectures till this video?
@@PKMKB93000 5 days
@@soumikmondalofficial impossible
@@PKMKB93000 I am just talking about graph series. This is no.10 video 🙂
@@soumikmondalofficial oh 🤣
More power to you bro itna time dedicate krne ke baad bhi itni bdia explanation chuma ekdum
Perfect Topic considering today's leetcode question of the day.
yeah u r riight
Thank you for this amazing course
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 !
bhai DSA kaha se kiya thaa & Question practice kaha se kii thi ???
CP bhi ki thi kya
@@Ayush_. without CP ? AMAZON ? you have got to be kidding with us ? even TCS digital requires CP. then it's AMAZON
@@sachinupreti7159 There is No need of DP if you are good in DSA
@@sachinupreti7159 konsa alcohol drink karrhe ho ajkal? send link
bro apne leetcode gfg and codestudio profile ke links dena please
It felt bad when he said "iss video ke sponsors nahi hai" with a smile.
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
4 videos good
Did you get 😢
Bhaiya negative comments ko plz ignore karna u r the best and we are always with you
Most importantly take care of your health
❣️❣️❣️❣️❣️
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😅
Aur kitne din chal sakta hai course
haa bhai aisa hai Dynamic programming bhi chale
Thank you so much bhaiya for such great DSA cotent
Energy++ , cosistency++
Bhaiya Apka y tutorial Bhut helpfull h😍 thanks ❤
lage rho bhiya consistancy maintain rakhna apke jaisa teacher koi nhi
low energy ?? Redbull should make you their brand ambassador Babbar bhaiya you have the best explanation!!
thank you!
Peche Wale me distance array samj nhi aaya tha but now is clear 👌👌💘
Thanks, aj subah se ye topic ka video dhund rha tha jis se kuch smz m ae
Hats off to your efforts bhaiya
100% placement oriented learning Bhaiya keep it up....
Consistency OP. Thank you bhaiya🙃😇
Bhaiya keep inspiring us we r with u
loving your lectures bhaiya
4:30 daro mat iss video mein koi sponsor nahi hai 🤖
Babbar bhaiya In this video-->>"Daro mat is video me sponsors nahin hain"🤣🤣🤣🤣
Amazing Explanation
Best dsa series ❤❤
Thank You So Much BHRATA SHREE !!!!!!!
Only sher of youtube in computer domain
Thanku Babbar Bhaiya for your efforts
Love bhaiya both sett video !! Bs ye record wala smjh nhi aya
consistency++, thankyou bhaiya
auto top = *(st.begin( )); means
iterator ko dereference kr rhe
190 ✅completed 👍Liked 04:39
can anyone explain how the set works to get top by minimum distance when it has pairs?
it takes the first value to compare ie the distance and set is sorted so it shows min distance always at the top
@@vasusharma3527 tq bro❤
are more videos coming in this free course?
definityely
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
wonderful explaination sir
Present bhaiya 🔥
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
quite a good series
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.
cuz we are updating distance every time so I guess there is no effect of taking nodes in sorted order by distance
@@rahulrawal6542 No thats wrong i tried doing this using normal queue and i was getting wrong answer
Brother because priority queue or set reduce the time complexity by vlogv . If you use queue time complexity will be nxn
Brother kindly object oriented programming or design pattern ke videos playlist banao.
why cant we do it using method used in last video?
Why time complexity O(E logV ) and not ((V+E)logV) ?
placement season has started and bs 45 vdos left and i am not able to be consistent , next 2 months placement will take place
great explanation bhiaya
daro mat iss video mai koi sponsers ni h ..got me laughing hard.
as i was expecting them as an habit.
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.
uhm...beside love babbar bhaiya,what are the alternatives to watch for?
I was About to skip when you said " daro mat iss video me koi sponsor nahi hai "
Consistency ++ bhaiya well done
Very helpfull
a wise man once said,"daro mat iss video mein koi sponsor nhi hai!!"
Bhaiyya please written notes update kardo bhaiya
Thankyou Bhaiya!!!
Can anyone tell me why we are picking smaller distance value first ?
consistency--
bhaiya aur videos kab daal rahe ho???
thanks a lot
great video
Prevent Burnout ☠💯
Bhaiya Next video? Agar fever hai toh take rest we will wait….get well soon.
Thank you bhaiya 🙏🙏... sab samaj aa gya
Bro how many days it took you to complete all video lectures till this video?
Around 40 days
@@tanishk1059 okay thanks for replying
one thing that was not mentioned or i might have missed:
dijkstra's algo doesn't work when there are edges with negative weights.
That's why bellman ford's algo come in existence
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.
@@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.
@@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
why do we have to pick minimum value only ? what is the use of set here
set is always ordered in case of cpp, so the top will always contain min distance
Keep going Bhaiya !!
can someone expliain why we are using set? why we need to select node with less distance in the set
amazing bhaiya!!!
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?
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.
isn't T.C O((V + E)logV)?
First🤩
Very nice sir
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
property of set , it stores data in sorted order by default
@@ADITYAKUMAR-tb4gm ok got it
Keep ti up sir ❤️❤️
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??
set is ordered but if you use map it will be unordered
Sir pleas please yeh course complete karna ..
Bhaiya code from graphs are not there in github repo. Please do push the codes in github repo.
Consistency op ❤️❤️
Sir in Notes link only notes till lecture 40 are provided where can we find rest??
bhai please ye waale code dedo or upload krdo , i have your paid course also but pta nhi idhar zaada smj aa rh
Bhai back in form....🤩🤩
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
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
Thank you bhaiya ❤
Swaad ++...🎉
❤ best
thank you bhaiya
Thanks Bhai 👍
please someone tell the video number at which sir taught SET
please complete series
Bhaiyaa Thankyouuu 🔥
Why negative weights fails for dijkstra algo?
Anyone please explain with help of this code
have you found answer?
@@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
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
@@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.🙂
brilliant
Bhaiya thankyou ❤️🔥
Great sir
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
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
Bhaiya video ka size pahle se chhota ho raha hai.....Please video ko thoda lamba kare to make better understanding....
I am having trouble creating adjacency list in java. This is what I have tried:
//create adjacency list
HashMap adj = new HashMap();
for(int i=0;i
loop wrong hai edges tak chalo
Thank you sir 🙏
daalo yrr videos baki ki
Aur kitne lectures lagne wale hain bhai?
Bhaiya phir kyun ruk gaye ho