I follow you just because, Other TH-camrs teach you main concept But You at first teach us how to overcome fear by teaching fundamentals first , then you teach main concept That's really helpful to weak student like me... And ofc in a group 95% are weak as me ... Not everyone is brilliant and we do not compare with them That also you teach us
just when i started this video i already knew a visited array and a min heap will be required i guess that's what you call a intuition. thank you so much i couldn't have thought once that i would come this far
Great video. I feel it is very much similar to Dijkstra. Just that in Dijkstra we maintain a dist array and in Prim we maintain a visited array as we don't want to find shortest distance. Once node is processed we can simply skip it.
We are given the vertices and edges so why would you start from vertex 4 and then go to 3?Wouldnt you always start from 0 and then go to 3?Besides even if we visit from right you'd still get the same sum and path . irrespective of whether you go from vertex v-1 to vertex 0 or vertex 0 to vertex v-1 you'd still choose the edges with minimum weight to achieve maximum possible sum while maintaining v-1 edges for v vertices condition
Hi Aman, Always first try to go for the brute force. It gives you a rough idea where the solution can be optimised and then proceed. And solve qns , keep practising. Only that will help
Pls clarify my confusion sir , If i change weight between 5-6 vertex 2 to 8 then path should be 4 2/ \4 weight 5----6= 8 /. \. &4-----5-----6 total=10 5. 6 But algorithms will give answer 4-5-6 because of 2 different ways from 4 , one is 2 weighted & another one is 4 weighted , but if we choose 4-5-6 path , sum = 10 while 4 to 5 & 4 to 6 gives 2+4= 6 only
awesome explanation bro, just one thing do we need to check both times one while adding to queue and one just after popping from queue? or just one check should work? also about the parent thing can we mark the starting node(0) as the parent of every other node since that is our starting point and everything is getting connected to that node indirectly one by one?
Marking 0 as the parent will make the graph all together different because it will seem that all the nodes are connected directly to 0 which is not the case.
Good qn. Actually you should add both the check because, it will unnecessarily add unwanted edges in the priority queue might unnecessarily make the while loop run more. And your 2nd part of the Qn is correctly answered above by @wearevacationuncoverers . Hope this helps ❤️❤️
Small correction: 19:11 --- The parent of 3 is 2 not 1
🙂
I spent 20 mins thinking why.. 😌
@@chandankumar-gv1hz same with me bro
@@shubhamjaiswal7645 mujhe bhi doubbt aaya hi thaa ,,,but 2 also comest after 1 thats why i thought it was right ...but it was wrong
3:56
I bet no one can build intuition like this but you bro
maja aa gya bhaiya 🥰🥰🥰 can't explain you the satisfaction level,
khud se dry run kiya pahle jo jo apne bola ha phir vdo dekha and khud code v kiya
I follow you just because,
Other TH-camrs teach you main concept
But
You at first teach us how to overcome fear by teaching fundamentals first , then you teach main concept
That's really helpful to weak student like me...
And ofc in a group 95% are weak as me ...
Not everyone is brilliant and we do not compare with them
That also you teach us
I am so glad to hear that! ❤️🙏
Intuition koi nai batata itne dedication se and dry run bhi ❤
Now Prims algorithm will be retained in my mind for all time. All thanks to you 👌🏻
Same
I am so glad 😇🙏
One notification from your channel is enough to cheer me up.
Thank you so much 🙏❤️
Bro I am getting obsessed with your explanation day by day ❤ just keep doing man it is really helpful.. respect++
Thank you so much Sachin 🙏❤️
King of GRAPHS
DSA 🔥🔥🔥🔥
I feel happy when I see, you have uploaded a solution which I am looking for. Best of best !!😁
3:56 NO ONE CAN TEACH LIKE YOU ❤
just when i started this video i already knew a visited array and a min heap will be required i guess that's what you call a intuition.
thank you so much i couldn't have thought once that i would come this far
waiting for dp playlist too your explanation is too good
Yea this week 😇
Elder brother I subscribed to you just at the moment you explained the intuition.
It means a lot to me Brother.
Thank you ❤️😇🙏
Great video. I feel it is very much similar to Dijkstra. Just that in Dijkstra we maintain a dist array and in Prim we maintain a visited array as we don't want to find shortest distance. Once node is processed we can simply skip it.
I will never forget it. Best explanation ❤
Your explanations are top notch. Code yaad nhi rakhna padta ab bas intuition yaad reh jata h ab❤
That’s the motive. Intuition should be there always.
So glad to hear. Thanks a lot ❤️❤️
I will never forget this. you are an amazing tutor
No one.....i repeat no else motivates like u do🥹
❤️❤️🙏🙏
nice video and explanation a small correction needed 19:11 the parent of 3 is 2 not 1 and rest of the things are just awsome
Thank you so much ❤️❤️🙏
make this guy education minister of india .....
Very well explained with intuition
Thank you so much 🙏🙏
awesome explanation!
Thank you so much Divyansh ❤️❤️🙏
OP Graph Series
I am so glad to hear that.
Thanks a lot ❤️🙏
at 8:00 why did you not consider the edge of (3,4) which has wt of 1. if we start from right side, we will have to include this right
We are given the vertices and edges so why would you start from vertex 4 and then go to 3?Wouldnt you always start from 0 and then go to 3?Besides even if we visit from right you'd still get the same sum and path . irrespective of whether you go from vertex v-1 to vertex 0 or vertex 0 to vertex v-1 you'd still choose the edges with minimum weight to achieve maximum possible sum while maintaining v-1 edges for v vertices condition
3:56 I bet no one can build intuition like this
🙏🙏❤️❤️
i will definitely say One day this chanel become most popular channelthankyou so much
Thank you so much
Means a lot 😇🙏
19:27 Parent of 3 = 2 ;
34/40 done ✅ thanks a lot bhaiya❤✌
34/41 done [8.12.23] ✅✅
Thanks brother 🙏
Thank you for watching 🙏😇
thank you sir
Bdiya.
Thank You :)
You're welcome! 😊❤️
Today’s POTD - th-cam.com/video/QIu9HeyEjPc/w-d-xo.htmlsi=N7C15PELOKP0UjDS
can we use ordered set instead of priority queue like we used in dijsktra ?
Sir, how to develop the intuition to solve problems, because your approach of examining does have a smooth flow.
Hi Aman,
Always first try to go for the brute force.
It gives you a rough idea where the solution can be optimised and then proceed.
And solve qns , keep practising. Only that will help
Thanks a lot
Pls clarify my confusion sir ,
If i change weight between 5-6 vertex 2 to 8 then path should be
4
2/ \4 weight 5----6= 8
/. \. &4-----5-----6 total=10
5. 6
But algorithms will give answer 4-5-6 because of 2 different ways from 4 , one is 2 weighted & another one is 4 weighted , but if we choose 4-5-6 path , sum = 10 while 4 to 5 & 4 to 6 gives 2+4= 6 only
awesome explanation bro, just one thing do we need to check both times one while adding to queue and one just after popping from queue? or just one check should work?
also about the parent thing can we mark the starting node(0) as the parent of every other node since that is our starting point and everything is getting connected to that node indirectly one by one?
Marking 0 as the parent will make the graph all together different because it will seem that all the nodes are connected directly to 0 which is not the case.
Good qn.
Actually you should add both the check because, it will unnecessarily add unwanted edges in the priority queue might unnecessarily make the while loop run more.
And your 2nd part of the Qn is correctly answered above by @wearevacationuncoverers . Hope this helps ❤️❤️
@@wearevacationuncoverers yess right i imagined it wrongly every node should have previous node only as parent
@@codestorywithMIK yaa correct its better to be safe n have both the checks
please complete this series
Yes yes, more videos coming as soon as I get back to India 🙏😇
U r an angel in our life bhaiya..🥹
Means a lot ❤️❤️🙏🙏
Thnx
Thank you for watching ❤️😇🙏
Bro please make video on agressive cow and book allocation problem.
Sure, noted ❤️❤️
What if we don't store parent of any node?
so min heap= priority queue
tc : EV logV right?
❤❤❤
Mast bhasan diya 😊 I was losing confidence
😇😇❤️
Nice
How is this different from djikstra
Sir graph par aur videos chahiye please 🥺
Yes, coming this week 😇
I can see that in djikstra we don't consider parent..
Can we say this is a greedy algorithm as we are taking the smallest edge at every step.
yes this is indeed greedy approach
good morning sir.
Morning! ❤️