Тёмный

Remove Max Number Of Edges To Keep Graph Fully Traversable || Graph theory 

Pepcoding
Подписаться 200 тыс.
Просмотров 9 тыс.
50% 1

Опубликовано:

 

7 окт 2024

Поделиться:

Ссылка:

Скачать:

Готовим ссылку...

Добавить в:

Мой плейлист
Посмотреть позже
Комментарии : 28   
@taukirkhatri3368
@taukirkhatri3368 2 года назад
Such an underrated Playlist... It deserves to be the first priority for every indian student learning DSA.... Highly recommended....
@shang_chi4651
@shang_chi4651 3 года назад
Sir itna shandar ques one go mein code karne laayak samjha diya aapne sir. This is the power of teachers at pepcoding. Baaki channel bas code walkthrough karwate. Kaise sochke code likhna hai wo to aap hi ne sikhaya hai sir..thanks team pepcoding 😁
@RahulRajav
@RahulRajav 3 года назад
Hi Subhesh, You have a very good Skill of Explaining things on top of your exceptional Algorithmic Knowledge and covering the point where one might get doubts in. I hope you will keep adding videos to this series, at this point of time, I am not able to find any good resource for Ford-Fulkerson and Edmond Karp Algorithm for Max Network flow, Could you please do it in this series, I request you to add that as early as possible for you. Doubt in that algorithm - negative edge doesn't makes complete sense to me. I have Google interview in coming days, hope you will help me with it. ~Cheers to the work you guys are doing for the community
@shang_chi4651
@shang_chi4651 3 года назад
Best of luck for your google interview👍.
@mickyman753
@mickyman753 3 года назад
thanks a lot team pepcoding and subhesh sir for this amazing graphs playlist
@amanchandna1100
@amanchandna1100 Год назад
very intuitive explanation, thanks
@ujwalkumar2374
@ujwalkumar2374 3 года назад
Kindly give problem link in the description. Thank you
@LegitGamer2345
@LegitGamer2345 3 года назад
What an explanation 💯
@shang_chi4651
@shang_chi4651 3 года назад
Hey, I have seen your comment in each and every video starting from the very beginning. Which year are you studying in? You must be very good at coding cuz someone who has been following this channel from.the beginning is bound to be a good coder😁
@LegitGamer2345
@LegitGamer2345 3 года назад
@@shang_chi4651 currently 2nd year Also , trust me , I’m not good at coding , I still fail many times when I solve new problems , probably more than 50% of the time But sometimes I can solve new problems only because I have done a similar problem in the past ,which is kinda cool
@shang_chi4651
@shang_chi4651 3 года назад
@@LegitGamer2345 you are so humble😁. May god give you all the success in life👍.
@LegitGamer2345
@LegitGamer2345 3 года назад
@@shang_chi4651 Thank you , may all your dreams come true :)
@_Rahul_Gehlot_
@_Rahul_Gehlot_ 3 года назад
Sir, kindly open the telegram group for discussions.
@sachin__ak
@sachin__ak 2 года назад
We can do this without sorting, first make a set of connection for type3 and calculate extra edges and then again calculate extra edges for alice and bob for type 1 and type 2 edges, keep track of number. of connected components of both the set, if any Ca or Cb != n then -1 else aliceEdge+bobEdge+redundantType3edge
@dipuprasad3694
@dipuprasad3694 3 года назад
thank you very much
@Prodcater
@Prodcater 3 года назад
Hi sir SNAKES and ladders wala question pe video bana do plz
@meme_engineering4521
@meme_engineering4521 3 года назад
++
@RahulRajav
@RahulRajav 3 года назад
Hi Subhesh, small optimization can be done in the code, it might degrade the readability but time complexity can be better, the optimization is: Rather than using Arrays.sort -> which in nlogn, simply have one for loop which will take into consideration only edge of Type 3 and mark them as visited then have the for loop again for other 2 types of edges. let me know if there is any fault or disadvantage of this approach.
@vatsalgp
@vatsalgp 3 года назад
No fault in approach. Visited array is not even needed. Just in the first iteration run only if type is 3. In the second iteration run for types 1 and 2.
@KejriwalBhakt
@KejriwalBhakt 2 года назад
You don't have to run the loop thrice. You can use a hashmap with Types as key. And run over the keys of hashmap. The space complexity might blow up but it will be done in single loop.
@RahulRajav
@RahulRajav Год назад
@@KejriwalBhakt Nice Thought, But I haven't suggested running the loop thrice, it is 2 times. That will be the case in your approach as well, moreover, it will take extra space as well, Here goes my explanation: 1> You will run through each edge to put it in your hashmap, so one loop is done. 2> For each type when you fetch the edges, on the values you will have to run a for loop, cumulative of which will be again O(n) we can say another set of traversal of all the edges. so, there is no extra benefit of Time complexity in this approach, and it is deteriorating the space complexity as well, let me know if you do not agree to it.
@mickyman753
@mickyman753 3 года назад
sir if possible make the rest 4 questions on graph level 2 too
@dipuprasad3694
@dipuprasad3694 3 года назад
abhi aur bhi video aenge kya graph pe
@vidit177
@vidit177 3 года назад
Please let us know
@mickyman753
@mickyman753 3 года назад
sir ne bola tha kya level 2 main aur ques add honge over the time
Далее
Number of island 2 || Graph theory
24:58
Просмотров 9 тыс.
очень грустно 😭
00:12
Просмотров 88 тыс.
As far from land as possible || Graph theory
29:32
Просмотров 15 тыс.
0-1 BFS | Advanced graphs
19:22
Просмотров 13 тыс.
Bus Routes || Graph theory
32:24
Просмотров 17 тыс.
Disjoint Set Union (DSU) || Graph theory
32:19
Просмотров 12 тыс.