G-55. Bridges in Graph - Using Tarjan's Algorithm of time in and low time

Поділитися
Вставка
  • Опубліковано 17 січ 2025

КОМЕНТАРІ • 226

  • @rushidesai2836
    @rushidesai2836 11 місяців тому +111

    Had to watch this 3 times to completely understand. Probably the most difficult of the playlist.

    • @az-zm4ji
      @az-zm4ji 6 місяців тому +2

      haha same. my brain got messed up from this algo

    • @Nutrino259
      @Nutrino259 4 місяці тому +2

      I watched this video. And again cam back to watch this after 4 days. Now i clearly understand whole process!!!!!!!!!!

    • @amansingh.h716
      @amansingh.h716 4 місяці тому

      thanks bro i am leaving this video

    • @princeroshan4105
      @princeroshan4105 3 місяці тому

      Instead of using the conventional approach with DFS tree, subtree of DFS tree, and back edges, he's trying to explain it in an unconventional way, which doesn't seem appropriate for this context. However, I can't really argue, considering he works at Google.

  • @venugopalreddy8596
    @venugopalreddy8596 2 роки тому +151

    I think this problem is very hard to explain. But striver did it very clearly....Awesome!!

    • @ChiragGaurav-gt9is
      @ChiragGaurav-gt9is Місяць тому

      I think he himself did not understand it properly, which made me spend hour to properly understand the concept

  • @rohinianekar61
    @rohinianekar61 Рік тому +57

    Well, in simple words, if the low[] of next node is less than the one which calls dfs for it, then there is a other node through which that node can be reached and which appeared before the one which calls the dfs, Thanks, Well Explained❤

    • @arpitkumarmishra2734
      @arpitkumarmishra2734 Рік тому +3

      kya bol rhe ho bhaya?

    • @amitdahiya7425
      @amitdahiya7425 Рік тому +5

      In Some details => if any adjacent node (except parent) has low time greater than curr node means node and adj node share an edge
      and the adj node is only reachable via this edge , so if we remove this edge we never gonna reach this adjNode , means this edge is a bridge

    • @amitdahiya7425
      @amitdahiya7425 Рік тому +5

      otherwise if low time is equal or lesser than curr node time , means that adjnode has other path which takes lesser or equal time than curr node , so if we try to remove this edge we still can reach the adjNode from other path , means they are still connected to each other , the edge is not a bridge

  • @schan263
    @schan263 Рік тому +9

    Thanks, I learned bridges before from a lengthy video somewhere and your video is a quick review and saves me lots of time.

  • @ABHIMANYUTHAPLIYAL
    @ABHIMANYUTHAPLIYAL 6 місяців тому +11

    had to spend too much time understanding it , now its clear. For those who could not understand this topic , i would suggest watch jenny lecture on bridges in graphs first, then come again to this lec, you will indeed have a lot more clarity.Because striver has explained it beautifully but to understand his approach you must know it from somewhere else before.

    • @thaman701
      @thaman701 6 місяців тому +1

      condition of critical edge why do we check lowest_time[recently popped node] > time[current node] and not lowest_time[current node]? pliz help bro

    • @devanshverma8050
      @devanshverma8050 6 місяців тому +1

      @@thaman701 we won't be comparing with lowest_time[current node] because lowest_time[current node] might have got updated cuz of the adjacent nodes of current node , the thing to note here is that lowest_time[node] doesn't mean that u will take that much time to reach the "node" but it's rather keeps track of the earliest visited node reachable from the subtree rooted at "node" , so while comparing with lowest_time[recently popped node] tells that there might be node connected to it that can be reached earlier and through that further adjacent nodes , and if it's greater than the time[current node] , then there's no point cuz to reach that node u will be requiring that much time at least, and from the recently popped node if u r taking more than that then it's not even possible to reach lower time cuz all other paths will at least take more time than that.

    • @thaman701
      @thaman701 6 місяців тому

      @@devanshverma8050 thnxx bhai

    • @NrN_RL_SIDESWIPE
      @NrN_RL_SIDESWIPE Місяць тому

      Thanks

    • @vinayakk2745
      @vinayakk2745 19 днів тому

      thanks for the suggestion! Jenny's lecture on this was really helpful!

  • @shklbor
    @shklbor 3 місяці тому +1

    zabardust bhai, nowhere is it as clearly explained as this. india is really vishav guru - we teach the entire world

  • @kartikpal9141
    @kartikpal9141 2 роки тому +12

    Insane stuff . So well explained

  • @kafkatamura2461
    @kafkatamura2461 24 дні тому

    Preparing for gate and was stumbled upon this problem. Thought for a long time to get some efficient way. Got it now. Thanks a lot.

  • @musharrafhussain130
    @musharrafhussain130 Рік тому +1

    hell yeah! Finally completed the series. Thanks a lot Striver!

  • @ganavijayaram7987
    @ganavijayaram7987 Рік тому +9

    Had to tell this!!
    First of all thank you very much for all the playlists!
    Secondly, how can you be soo good at knowing what we understand and we don't.
    @3:26 timestamp, you just knew that the first timer's might not understand, and you assure we will understand it later.
    its like 1:1 where we tell we didn't understand, and you say that you'll understand later in the lecture.
    Damn nice!

  • @kushjoshi9716
    @kushjoshi9716 Рік тому +5

    It was hard first but then I watched the video twice and now I understand the problem. Striver is amazing!

  • @40_arkoprovodatta23
    @40_arkoprovodatta23 2 роки тому +9

    A visited array is not needed, if tin is initialized with -1, we could check if tin[i] == -1. Btw, an amazing explanation. ❤

    • @cr7johnChan
      @cr7johnChan 2 роки тому

      can u please tell me why my code does nt work for larger test cases
      vectorans;
      void dfs(int node,int dad,vector&low,vector&visited,vectorgraph[]){
      visited[node]=1;
      low[node]=node;
      for(int j=0;jlow[node]) {
      ans.push_back({node,t});
      }
      }else if(low[t]

    • @TusharRaghav
      @TusharRaghav Рік тому +3

      @@cr7johnChan your condition low[t] > low[node] is wrong, it should be low[t] > in[node]

  • @stith_pragya
    @stith_pragya Рік тому +1

    Understood, Thank You So Much for this wonderful video...........🙏🏻🙏🏻🙏🏻🙏🏻🙏🏻🙏🏻

  • @ajaybind6736
    @ajaybind6736 9 місяців тому

    this is only explanation can be for this tough question on youtube thanks striver !!

  • @harshalyallewar
    @harshalyallewar 4 місяці тому

    00:04 Bridges in a graph are edges whose removal breaks the graph into two or more components.
    02:24 Finding bridges in a graph using Tarjan's algorithm
    04:42 Tarjan's algorithm determines bridges in graph
    07:07 Determining if a node is a bridge in a graph
    09:22 Using Tarjan's Algorithm for bridges in graph
    11:36 Identifying bridges in a graph using Tarjan's algorithm
    14:01 Understanding the concept of bridges in graphs using Tarjan's Algorithm.
    16:10 Finding critical connections in a graph using Tarjan's Algorithm
    18:14 Using Tarjan's algorithm to find bridges in a graph
    20:20 Tarjan's algorithm identifies bridges in a graph
    22:08 Discussing time and space complexity for using Tarjan's Algorithm in graph
    Crafted by Merlin AI.

  • @meepo-yk7jc
    @meepo-yk7jc 5 місяців тому +3

    I realized that Tarjan's algorithm not only can find the bridges but also Strongly Connected Components(SCC), learn a lot, thanks Striver

  • @UECAshutoshKumar
    @UECAshutoshKumar Рік тому +1

    Thank you sir 🙏

  • @psurya3053
    @psurya3053 2 роки тому +6

    thank you sir , i understood , after this can you make vedios on further depth topics in graph like flows and cuts etc.
    your explanation is the best on the youtube.
    i would like to purchase your courses for competitive programming , if you are teaching.

  • @sagarprajapati6026
    @sagarprajapati6026 11 місяців тому

    yr bhai hard ko itta simple Hats off to you bhai🤗🤗

  • @bhavya8608
    @bhavya8608 Рік тому +1

    a tough problemmm but you explained it really well!!! Thank you so much!!!

  • @mrf92
    @mrf92 Рік тому

    amazing striver!! your are a true genius

  • @nealgautam1882
    @nealgautam1882 Рік тому +21

    In the LeetCode problem, it has provided connected graphs as input however, for added functionality for disconnected graphs, the function call for dfs can be done like this:
    for(int i=0;i

    • @muditkhanna8164
      @muditkhanna8164 Рік тому +1

      only if the question was named as find the critical connections in all the networks

  • @huungryyyy
    @huungryyyy 5 місяців тому +1

    Ok got it after watching twice but i guess it will take some time to digest .Thanku Striver Sir

  • @keertilata20
    @keertilata20 2 роки тому +4

    bhaiya, after the end of the playlist, please provide us a list of all the problems you solved in one place(similar to the sde sheet). It would be a great help when we will do the revision of the graph

  • @iamnoob7593
    @iamnoob7593 3 місяці тому

    Hey Striver what a superb video , Came back to revise , Fantastic understood.

  • @gauravbanerjee2898
    @gauravbanerjee2898 Рік тому +1

    Crystal clear explanation thanks a lot

  • @mysteryman3737
    @mysteryman3737 Рік тому

    God!! How could you explain it so nicely.... Thank you so much for the explanation

  • @skblabla
    @skblabla 2 місяці тому

    You are so good at algorithms, hopefully we will study a dedicated Striver's algorithm one day ! 😁

  • @PriyanshuVerma-p9b
    @PriyanshuVerma-p9b 6 місяців тому

    Awesome explanation man ----------Thankyou so much

  • @manasranjanmahapatra3729
    @manasranjanmahapatra3729 Рік тому

    Understood. Great explanation for a Hard problem.💯

  • @fighter7224
    @fighter7224 26 днів тому

    thank you striver 🤗

  • @mriduljain6809
    @mriduljain6809 Рік тому

    Understood!! Explanation was very clear :))

  • @amanxsharma
    @amanxsharma Рік тому

    u did the best possible to make me understand ..thankyou

  • @lavanya_m01
    @lavanya_m01 10 місяців тому +3

    INTUITION:
    Let nodeA be a parent and nodeB be it's adjacent node.
    Bridge exists between nodeA and nodeB only if nodeB is not already visited and the lowest time of nodeB (the lowest time gathered among all it's adjacent neighbours) is greater than the time of insertion of nodeA. Hence nodeB cannot reach nodeA.
    We're checking for a bridge only if nodeB is not already visited because, if it was already visited, the existing edge is like a cycle (i.e another way of reaching nodeB through nodeA) So even if we remove this edge, we can anyway visit nodeB from the path that we came.

  • @isheep9025
    @isheep9025 Рік тому +21

    alternative method:
    an edge can be a bridge if and only if its is not a part of a cycle

    • @mahasinhossen2502
      @mahasinhossen2502 Рік тому +2

      this method will take O(e(v+e)) time. you will need O(v+e) time for every edge to check if it is in a cycle.

  • @AdityaKumar-be7hx
    @AdityaKumar-be7hx Рік тому +1

    Understood! This was the question asked by google when I was in college. Only if this resource was present then :)

  • @ashwinashok1998
    @ashwinashok1998 2 місяці тому

    Nice explanation!

  • @vcs649
    @vcs649 Рік тому

    Awesome explanation and presentation as well

  • @r_uhi05
    @r_uhi05 9 місяців тому

    Great explanation to such a hard prob. Understood!

  • @SeloniSinha
    @SeloniSinha Рік тому

    Understood sir!!! Such an awesome explanation!!! Loads of thanks sir😄

  • @praptib
    @praptib 4 місяці тому +1

    condition for bridge is low[node] > tin[neigh] and not low[node] > low[neigh]
    bcz for eg if node is 8, it can have low 3/6, and if neigh is 10, it can have low 3/6
    so we can't compare lows of each other nor can we track just the current low and increment and decrement later as all nodes should be unique
    so tim array is used

  • @chiranjiveethakur
    @chiranjiveethakur Рік тому

    Very nice explanation!

  • @varunakrishnani7688
    @varunakrishnani7688 Рік тому

    Understood! :)
    Thank you! 😊

  • @udaypratapsingh8923
    @udaypratapsingh8923 Рік тому +1

    understooood 🐼

  • @namangokhru3715
    @namangokhru3715 Рік тому

    you are also a good english teacher

  • @Hemus212
    @Hemus212 Рік тому

    understood !! beautiful explanation

  • @taruchitgoyal3735
    @taruchitgoyal3735 Рік тому

    Great explanation. Thank you

  • @youracademicfriend-shashwa1051
    @youracademicfriend-shashwa1051 6 місяців тому

    Thankyou!!
    Nice explanation

  • @tkr483
    @tkr483 7 місяців тому

    You're realy great ❤

  • @cinime
    @cinime 2 роки тому +3

    Understood! So amazing explanation as always, thank you very much!!

  • @GANESHSINGH-uc1gk
    @GANESHSINGH-uc1gk 2 роки тому

    dayummm....amazing explanation!!!!!!!!!

  • @deepak_joshi_the_conqurer_
    @deepak_joshi_the_conqurer_ 2 роки тому +1

    Thank you striver sir!!

  • @nirbhay0799
    @nirbhay0799 Рік тому

    Awesome striver👏

  • @abhirupadhikary4274
    @abhirupadhikary4274 6 місяців тому +1

    For condition of critical edge why do we check lowest_time[recently popped node] > time[current node] and not lowest_time[current node]?

    • @thaman701
      @thaman701 6 місяців тому

      same query did u get the answer??

    • @abhirupadhikary4274
      @abhirupadhikary4274 6 місяців тому

      @@thaman701 Nope

    • @thaman701
      @thaman701 6 місяців тому

      @@abhirupadhikary4274 😆😆😆shi h.bhai

  • @shivkrishnajaiswal8394
    @shivkrishnajaiswal8394 Рік тому

    Good explanation.

  • @16avikasgupta70
    @16avikasgupta70 Рік тому

    My bro got some different level of energy

  • @ramyashrip9791
    @ramyashrip9791 3 місяці тому

    No audio after 0:23?

  • @rishabhgupta9846
    @rishabhgupta9846 2 роки тому

    understood,great explanation

  • @ravisingh-el8np
    @ravisingh-el8np Рік тому +30

    striver I know you teach good but just for this video sorry to say but this video is not much clear to a beginner like me and others also ,i watched jenny lecture and love babbar on this topic that was way more clearer. It's just a constructive feedback from one of your students. I watched your entire graph playlist but just for this video and articulation points video i had to refer others.

  • @gangsta_coder_12
    @gangsta_coder_12 Рік тому

    Understood 🔥🔥

  • @VarunSharma-xd8xd
    @VarunSharma-xd8xd 10 місяців тому

    great explanation

  • @reshusingh3558
    @reshusingh3558 Рік тому

    understood sir thankyou for your teaching

  • @subhradippalit5757
    @subhradippalit5757 2 роки тому +2

    Didnt understood the if condition ,where we are collecting the bridges.
    why are we taking low[it]>tin[node] ?

    • @takeUforward
      @takeUforward  2 роки тому +5

      If the adjacent nodes lowest time is smaller or equal to current node, so it can reach again via some path, so if its greater, it cannot!

    • @subhradippalit5757
      @subhradippalit5757 2 роки тому

      @@takeUforward okay got it , Thanks !

    • @cr7johnChan
      @cr7johnChan 2 роки тому +1

      @@takeUforward can u please tell me why my code does nt work for larger test cases
      vectorans;
      void dfs(int node,int dad,vector&low,vector&visited,vectorgraph[]){
      visited[node]=1;
      low[node]=node;
      for(int j=0;jlow[node]) {
      ans.push_back({node,t});
      }
      }else if(low[t]

    • @anishraj66
      @anishraj66 Рік тому +1

      @@cr7johnChan i have also same doubt bro u check your if condition if(low[t]>low[node]) i think this also should work but dont know why its not working

  • @girikgarg8
    @girikgarg8 2 роки тому +2

    In the else case at line 22, it should be low[node]=min(low[node],tin[it])

    • @roushanraj8530
      @roushanraj8530 2 роки тому

      yes

    • @cr7johnChan
      @cr7johnChan 2 роки тому +1

      can u please tell me why my code does nt work for larger test cases
      vectorans;
      void dfs(int node,int dad,vector&low,vector&visited,vectorgraph[]){
      visited[node]=1;
      low[node]=node;
      for(int j=0;jlow[node]) {
      ans.push_back({node,t});
      }
      }else if(low[t]

    • @sauravchandra10
      @sauravchandra10 Рік тому

      No, it is fine. Watch the explanation again

  • @raunakkumar6144
    @raunakkumar6144 Рік тому +2

    Amazing explanation , cleared my doubt why we are not considering parent edge. Thanks !

    • @shubhamgoswami3722
      @shubhamgoswami3722 Рік тому +6

      yes i struggled it too. The main concept behind this algo is , let's say if a parent left its child , and if child don't have access to its ancesstors or grandparents , then the child can't be connected to it's lineage , i.e its a bridge between parent and a child (child don't have any back edge).
      The second point is why we are not looking for the low time of parent is, if we closely look into dfs , and let's say a parent have many childs but while dry running we choose any one of the child and move forward to do dfs with that choosen child and while again returning we give chance to the other child from the rest ones , so a parent updates it's low if it's any of the child's low is smaller that is if any of it's child is connected to the ancesstors , that means the parent can also access to it's parent via his child. But a child don't update it's low with it's parent's low because in dfs we came to dfs of child and parent is visited and irrespective of whether a parent have access to it's ancesstor or not , but it's already visited so we can't go back to tha parent . :)

  • @9-1939
    @9-1939 Рік тому

    Best 🔥👌

  • @priyabratamaji
    @priyabratamaji 2 роки тому

    great bro😍😍😍

  • @20je086Saphal
    @20je086Saphal Рік тому

    //to reach the nbr needs for time than node's insertion i.e. only possible when nbr is solely traversed via that node hence it is critical component or a Bridge!
    if(time[node] < low[nbr]){
    bridges.push_back({node,nbr});
    }

  • @balakrishnanr648
    @balakrishnanr648 Рік тому +2

    Us, but indeed a HARD Problem. Like Go through multiple times the video, think a lot internally in the brain. Then Code.

  • @herculean6748
    @herculean6748 Рік тому

    Thanks🙌

  • @suryakiran2970
    @suryakiran2970 Рік тому

    Understood❤

  • @amritanshu1402
    @amritanshu1402 Рік тому +2

    Loved the way you explained such a hard concept in the easiest manner! Thanks a lot.
    Guys the least we can do is to smash the subscribe and the like button :)

  • @hrishikeshbakshi8961
    @hrishikeshbakshi8961 Рік тому

    This was difficult! But Understood!

  • @worldfromhome4033
    @worldfromhome4033 Рік тому +1

    Took me watch the video 2 times to understand but yeah understood!

  • @pulkitjain5159
    @pulkitjain5159 Рік тому +6

    Comments Padke and Video dekh ke I felt thoda lost , doosri teesri baar dekhne pe thoda anaolgy se samjhne ka try kiya then samajh aya thoda kya hora hai.
    theek toh m thoda samjhane ka try karta hu , suppose
    1.) TIN[ node ] is ki mujhe is node tak aane m kitna time laga ,
    2.) LOW[ node ] tells ki mujhe is node pe aane pe minimum kitna time laga.
    ab ise dekho , suppose m parent pe khada hu aur m child pe gaya tha ->
    when we got a bridge :->
    parent -> dekh child mujhe khud tak aane m TIN [ parent ] = 8 sec(suppose) lage hai toh m tujh tak toh 9th second m pahuch jaunga
    child -> yaar parent 🥲, mujhtak toh minimum aane m hi LOW[ child ] = 10 sec lag jayenge , kaha se ayega tu mujhtak
    TIN[ parent ] < low [ child ].
    hence we got a bridge.
    when not a bridge :->
    parent -> dekh child mujhe khud tak aane m TIN [ parent ] = 8(suppose) sec lage hai toh m tujh tak toh 9th second m pahuch jaunga
    child -> are parent mein toh khud par LOW[ child ] = 6 sec m hi pahuch jaunga , tu esa kar mere saath aja , jaldi pahuch jayega
    LOW [ parent ] = LOW [ child ].
    let's write a pseudo code using this analogy
    dfs( node , parent , timer ){
    visited [ node ] = true; // mark myself visited
    tin [ node ] = low [ node ] = timer; // noting the time at which i came on this node
    timer++; // increase the timer
    // get all neighbours
    for( nbr : adj [ node ] ){
    if(nbr == parent ) continue; // leave it
    if(visited [ nbr ] == true ) {
    // lol , phele se hi visited hai definetly kisi aur raste se aya hoga isliye visited hogya
    // sirf low ki baat cheet kar sakta yani mein
    low [ node ] = min( low [ node ] , low [ nbr ] );
    }else{
    // visited nahi hai , yani yaha m parent child wali baate kar sakta hu , child mera nbr ban jayega , parent meri node
    dfs( nbr , node , timer + 1)
    // now , parent bolta , mujhtak aane ka time TIN , tu tera minimum bata
    // mereko minimu hi LOW[ nbr ] time lagra 🥲, tujhe toh aur time lag jayega
    if( low [ nbr ] > tin [ node ] ){
    // found potential bridge
    }
    // mereko minimum LOW[ nbr ] time lagra , aur yeh tujhtak ( parent ) pahuchne ke time se better hai , ise badiya tu mere through aja
    else{
    low [ node ] = min( low [ node ] , low [ nbr ]);
    }
    }

    • @pulkitjain5159
      @pulkitjain5159 Рік тому

      samakj ni aaye toh ek baar is analogy se dry run karlena , ajaye toh badiya

    • @Aman-dl6cf
      @Aman-dl6cf Рік тому

      BEST COMMENT EVER , 🔥🔥🔥🔥

    • @Aman-dl6cf
      @Aman-dl6cf Рік тому

      THNX

  • @ACUCSPRADEEPB-up9ne
    @ACUCSPRADEEPB-up9ne 2 роки тому

    Understood ✌️

  • @vesperflix2211
    @vesperflix2211 2 роки тому

    Thanks a lot man

  • @samarthdengre9706
    @samarthdengre9706 Рік тому

    Please add a video for Kuhn's algorithm

  • @amittiwari360
    @amittiwari360 11 місяців тому +1

    why low[it]>tin[s] , and not low[it]>low[s] , please tell me because when i did this 15/17 test case pass , i am not able to make that graph condition where this is failing , please help me striver.

    • @umeshhbhat
      @umeshhbhat 11 місяців тому

      I had the same doubt, did you find the answer for this?

  • @parshchoradia9909
    @parshchoradia9909 Рік тому

    Understood SIr!

  • @gsmdfaheem
    @gsmdfaheem 2 роки тому +3

    Is this new leetcode UI available to everyone?? because mine is still normal and this one looks super cool!
    Btw awesome explanation..Crystal clear

  • @phoenix_1_3
    @phoenix_1_3 Рік тому

    for directed graphs, we have kosaraju algo. for undirected graphs, there is tarjan's algo. right??

  • @valarmorghulis9244
    @valarmorghulis9244 Рік тому

    why did you take the timer as global variable. Cant we pass it from main?

  • @roniljain1774
    @roniljain1774 11 місяців тому

    I wish I could talk to my code the way you do ❤

  • @TranTrungKien-us1lu
    @TranTrungKien-us1lu 2 роки тому +2

    can we call "TUF" is "The University Free" ?

  • @saillaanil2604
    @saillaanil2604 Рік тому +2

    the inititution is:
    the "tin" vector stores the steps/order in which we are visiting the nodes and the "low " vector is used to store the recent/(previously visited) node from which we can visit the current node. So if their is no previously visited to reach that node then it is a bridge.

  • @p38_amankuldeep75
    @p38_amankuldeep75 2 роки тому

    understood💥💥💥

  • @RituSingh-ne1mk
    @RituSingh-ne1mk 11 місяців тому

    Understood!

  • @SaiPhaniRam
    @SaiPhaniRam 2 місяці тому

    Intuition:
    Lets say, we need 'x' steps to reach a node 'u'.
    To mark an edge btw (u, v) as critical,
    - we should not have any other neighboring nodes to 'v' that can be reached in

  • @kiransequeira6152
    @kiransequeira6152 2 роки тому

    Thank you

  • @evilpollination1916
    @evilpollination1916 8 місяців тому

    Your dry run made my brain wet. Understood so well.

  • @GAURAVSINGH-t9p
    @GAURAVSINGH-t9p 7 місяців тому

    Why do we need tin array, why cant we just solve it using low array, cant we just change
    if (low[it] > tin[node]) {
    bridges.push_back({it, node});
    }
    to
    if (low[it] > low[node]) {
    bridges.push_back({it, node});
    }
    Where does it fails, i tried finding the counter example but wasn't able to

  • @iamnoob7593
    @iamnoob7593 Рік тому

    Superb

  • @sukhpreetsingh5200
    @sukhpreetsingh5200 2 роки тому +1

    Awesome

  • @tanmaybro3812
    @tanmaybro3812 Рік тому +1

    7:50 is the crux of whole video

  • @riyarsharma4667
    @riyarsharma4667 Рік тому

    Understood striver😇

  • @mayankjain-901
    @mayankjain-901 9 місяців тому

    Can't we only use minTime to compare and find the edge is bridge or not , like minTime[node] < minTime[child] , then it is a bridge ,assuming minTime will also be equal of nodes that have a edge and it is not a bridge ?

  • @sivakumar-wr1hn
    @sivakumar-wr1hn 2 роки тому

    Just wondering if we find node with only one incoming edge and its parent would be the part of result.

  • @nitinbhattacharyya8784
    @nitinbhattacharyya8784 Рік тому

    Will this work for directed graphs as well?

    • @hardikgupta7805
      @hardikgupta7805 Рік тому

      Yes , in case of directed graphs this problem gets converted to Strongly connected components problem only.

    • @niteshsaxena03
      @niteshsaxena03 7 місяців тому

      Kosaraju algo is used for directed graphs

  • @manojnavinjamuri5867
    @manojnavinjamuri5867 Рік тому

    lil complex but will watch thrice