Critical Connections in a network | Leetcode #1192 | Tarjans algorithm for bridge

preview_player
Показать описание
This video explains a very important programming interview problem which is to find the critical connections in a network.This problem is from leetcode 1192.This problem is a popular problem which asks to find all the bridges in a graph.A bridge is an edge, removing which increases the number of components in a graph.Critical connection is same as a bridge.We can efficiently find bridges in a graph using Tarjans algorithm which i have already explained and the link for that will be present below.I have explained the problem statemment first and then showed its relation with bridge problem.I have shown the code at the end of the video.CODE LINK is present below as usual. If you find any difficulty or have any query then do COMMENT below. PLEASE help our channel by SUBSCRIBING and LIKE our video if you found it helpful...CYA :)

========================================================================
Please SUPPORT us /\ by JOINing our channel and also get access to perks:

=======================================================================

USEFUL LINKS:-

#bridge #tarjansalgorithm #graph
Рекомендации по теме
Комментарии
Автор

Recently got this question in Goldman Sachs test. Thanks for great explanation Sir :)

minakshikudalkar
Автор

I recently had a Amazon coding round pas two days.
It's the same question I got there.

bhaveshvaviya
Автор

I got the same question in Amazon OT on 23rd September. Wish I had watched this earlier!!!!

parteeksatija
Автор

if i got job i will applaud every video i see

rakeshreddyabbireddy
Автор

every cross edge of tarzan's algo should be a critical edge right?

amitavamozumder
Автор

Sir, If I'm using vector of vector to represent the adjacency list then it's giving TLE but if I'm using array of vector then it passed all the test cases successfully . Sir, Can u please tell me the reason why it's happening ??

nitishgoyal
Автор

please cover "Partition to K Equal Sum Subsets"...

tonystarc
Автор

Sir if u could explain this question . leet code (Super Washing Machines)


You have n super washing machines on a line. Initially, each washing machine has some dresses or is empty.

For each move, you could choose any m (1 ≤ m ≤ n) washing machines, and pass one dress of each washing machine to one of its adjacent washing machines at the same time .

Given an integer array representing the number of dresses in each washing machine from left to right on the line, you should find the minimum number of moves to make all the washing machines have the same number of dresses. If it is not possible to do it, return -1.

prashantbhalla
Автор

I am observing that you are covering graph topics in the recent videos, but the major focus in the interview is dp. I request you to post videos on dp problems also. Also, I have seen that most graph problems are related to dfs and bfs with alterations.

bharatkumar-beki