G-54. Strongly Connected Components - Kosaraju's Algorithm

  Рет қаралды 144,355

take U forward

take U forward

Күн бұрын

Пікірлер: 221
@nakulmantri1235
@nakulmantri1235 23 күн бұрын
Undeniably the best teaching methodology and the content for strengthening DSA
@adithyabhat4770
@adithyabhat4770 Жыл бұрын
Your videos and the SDE sheet are helping me so much to brush up the DSA concepts and learn the ones I ignored in college. A BIG THANK YOU!!
@sahiltambe9085
@sahiltambe9085 2 ай бұрын
Your explanation goes straight inn , such a brilliant teacher!!
@dishant930
@dishant930 Жыл бұрын
I think after seeing the video if you read the striver sheet explanation for the same question it will give you more insight since it is really well written. I really liked it!
@siddharth.chandani
@siddharth.chandani Жыл бұрын
Can you provide me link of that..
@nanireddy3606
@nanireddy3606 9 ай бұрын
It is in the description
@KUMARASHISHRANJAN
@KUMARASHISHRANJAN Жыл бұрын
The above code gave me `TLE` so, with few minor changes it will work for you. To optimize the given code, you can make a few changes to improve its efficiency: 1. Pass the `adj` vector as a reference to the `dfs` function: Currently, the `adj` vector is passed by value, which creates a copy of the vector in each recursive call. Instead, pass it by reference to avoid unnecessary copies. 2. Use a vector of vectors (`adjT`) instead of an array of vectors for the transpose graph: Declaring `vector adjT[V]` as a variable-length array may cause a stack overflow for large values of `V`. Instead, use a vector of vectors to represent the transpose graph (`adjT`). 3. Reserve memory for the transpose graph vectors: Before pushing elements into `adjT`, reserve memory for each vector based on the size of the corresponding adjacency list in the original graph. This avoids frequent reallocations and improves performance. 4. Use vectors instead of stacks: Instead of using a stack to store the finish times of the nodes in the first DFS, you can use a vector and append nodes at the end. This eliminates the need for reversing the stack later on. Here's the optimized code with these changes: Code : class Solution { private: void dfs(int node, vector& adj, vector& vis, vector& finishOrder) { vis[node] = 1; for (int it : adj[node]) { if (!vis[it]) { dfs(it, adj, vis, finishOrder); } } finishOrder.push_back(node); } void dfs2(int node, vector& adj, vector& vis) { vis[node] = 1; for (int it : adj[node]) { if (!vis[it]) { dfs2(it, adj, vis); } } } public: // Function to find the number of strongly connected components in the graph. int kosaraju(int V, vector& adj) { vector vis(V, 0); vector finishOrder; for (int i = 0; i < V; i++) { if (!vis[i]) { dfs(i, adj, vis, finishOrder); } } // Creating the transpose graph (adjT) vector adjT(V); for (int i = 0; i < V; i++) { vis[i] = 0; for (int it : adj[i]) { adjT[it].push_back(i); } } // Last DFS using the finish order int scc = 0; for (int i = V - 1; i >= 0; i--) { int node = finishOrder[i]; if (!vis[node]) { scc++; dfs2(node, adjT, vis); } } return scc; } }; These optimizations should improve the efficiency of the code.
@HanumaVamsi2001
@HanumaVamsi2001 Жыл бұрын
Thanks a lot man!!
@muditkhanna8164
@muditkhanna8164 Жыл бұрын
yeah that improves the code a lot!
@khubanzehra7632
@khubanzehra7632 7 ай бұрын
Thank you so much
@kushagrasrivastava1443
@kushagrasrivastava1443 2 жыл бұрын
I thought I was done with graphs 😅
@SomeshCodes
@SomeshCodes 9 ай бұрын
Literally me too...😅
@bharat_alok11
@bharat_alok11 2 ай бұрын
@@SomeshCodes me too
@vaibhavgupta7429
@vaibhavgupta7429 Ай бұрын
thanks for the clear explanation of this complicated topic
@neelulalchandani7429
@neelulalchandani7429 3 ай бұрын
Brilliant explanation! Thanks for the graph series, the best teacher ever!
@rishabhjain6272
@rishabhjain6272 5 ай бұрын
the first step is same as topo sort using dfs technique, will not work with bfs (khann's algo) due to directed cyclic graphs.but if you apply topo sort using dfs in directed cyclic graphs ,it will work.
@cinime
@cinime 2 жыл бұрын
Understood! Super excellent explanation as always, thank you very much!!
@ShreyaLanka-1912
@ShreyaLanka-1912 4 ай бұрын
Understood!! Thank you for this amazing explanation.
@muskanchaurasia1532
@muskanchaurasia1532 Жыл бұрын
Just amazing. Great Explanation.
@stith_pragya
@stith_pragya 11 ай бұрын
Thank You So Much for this wonderful video..............🙏🏻🙏🏻🙏🏻🙏🏻🙏🏻🙏🏻
@chandrachurmukherjeejucse5816
@chandrachurmukherjeejucse5816 Жыл бұрын
And here comes the real OG Striver.❤
@eswartharun3394
@eswartharun3394 2 жыл бұрын
This is much intutive than the previous video on kosaraju(other graph playlist)
@takeUforward
@takeUforward 2 жыл бұрын
Yes I read the comments, and then made this one.
@dhirendrasingh6071
@dhirendrasingh6071 Жыл бұрын
@@takeUforward you have changed the lives of so many students, you have blessings of many. ♥️
@tanmaypal2003
@tanmaypal2003 Жыл бұрын
​@@takeUforward when we sort all the edges according to finishing time and store it in stack like this 0,1,2,3,4,5,6,7 , so instead of storing in stack can we use queue and then when we pop out elements from queue we start DFS from 7 instead of 0 and 7 is not connected to anyone so we found 1st SCC then we pop 6 and do DFS and found 2nd SCC then we pop 3 and do DFS and got 3rd SCC and so on. In this approach we don't need to reverse the graph. Can we do like this?
@vishalsinghrajpurohit6037
@vishalsinghrajpurohit6037 Жыл бұрын
@@tanmaypal2003 Nice observation. I think this should work fine.
@theSoberSobber
@theSoberSobber Жыл бұрын
@@tanmaypal2003 yes
@adebisisheriff159
@adebisisheriff159 10 ай бұрын
Honestly, this playlist deserves Millions views and comments..... Thanks for all you do Striver!!!
@KaushalDhruw
@KaushalDhruw Жыл бұрын
Finally understood kosaraju algo. Thank you striver.
@augustinradjou3909
@augustinradjou3909 9 ай бұрын
Going to end the graph..❤ understood
@vaishalidev6621
@vaishalidev6621 2 ай бұрын
you are really good man!!! appreciate ur clarity of thoughts and words!! kudos and best wishes!!🎉
@nizh3278
@nizh3278 20 күн бұрын
My Last graph question for this series 😊
@andreasleonidou3620
@andreasleonidou3620 Жыл бұрын
Excellent tutorial and really helpful, thanks!!
@iamnoob7593
@iamnoob7593 Ай бұрын
Man Striver ur incredible
@mraryanrajawat9693
@mraryanrajawat9693 2 жыл бұрын
class Solution { private: void dfs(int node,vectoradj[],vector&vis,stack&st) // dfs for adj { vis[node]=1; for(auto it:adj[node]) { if(vis[it]==0) { dfs(it,adj,vis,st); } } st.push(node); } void dfs2(int node,vectoradjT[],vector&vis) // dfs for adjT { vis[node]=1; for(auto it:adjT[node]) { if(vis[it]==0) { dfs2(it,adjT,vis); } } } public: //Function to find number of strongly connected components in the graph. int kosaraju(int V, vector adj[]) { vectorvis(V,0); stackst; vector adjT[V]; // adj list after reversing edges for(int i=0;i
@rahulsangvikar7973
@rahulsangvikar7973 7 ай бұрын
Just realised one thing. You can avoid reversing the graph if you were to put the time in a queue instead of a stack.
@reee896
@reee896 6 ай бұрын
No you need stack cause if you use Queue it will keep going on to next SSC using the visited araay
@KeigoEdits
@KeigoEdits 3 ай бұрын
exactly my thought
@rohinianekar61
@rohinianekar61 Жыл бұрын
understood, nice explanation
@sahilbheke4083
@sahilbheke4083 Жыл бұрын
You are a very good teacher apse sikhna easy lagta hai
@ManishKumar-zm9rj
@ManishKumar-zm9rj Жыл бұрын
We can use the same dfs again by passing a dummy stack: public void dfs(ArrayList adj, int[] vis, Stack st, int node){ vis[node] = 1; for(int it : adj.get(node)){ if(vis[it] == 0){ dfs(adj, vis, st, it); } } st.push(node); } //Function to find number of strongly connected components in the graph. public int kosaraju(int V, ArrayList adj) { int[] vis = new int[V]; Stack st = new Stack(); for(int i = 0; i < V; i++){ if(vis[i] == 0){ dfs(adj, vis, st, i); } } ArrayList adjT = new ArrayList(); for(int i = 0; i < V; i++) adjT.add(new ArrayList()); for(int i = 0; i < V; i++){ vis[i] = 0; for(int it : adj.get(i)){ // previously: i -> it // Now make it: i i adjT.get(it).add(i); } } int scc = 0; while(!st.isEmpty()){ int node = st.pop(); if(vis[node] == 0){ scc++; dfs(adjT, vis, new Stack(), node); } } return scc; }
@Emperor723
@Emperor723 6 ай бұрын
mazaaaaaaa aaaaaaaagyaaaaaaaaaaa this is first time i have come across any of your videos der aaye par durust aaye.... let me subscribe!
@abcsumits
@abcsumits Жыл бұрын
sorting according to finish time can be done using toposort:)
@deviprasad_bal
@deviprasad_bal Жыл бұрын
that is toposort only. Toposort can be done using stack and that's what it is here.
@DheerajDivaker
@DheerajDivaker Жыл бұрын
@abcsumit Toposort banega hi nahi, wo sirf DAG mein work karta hai.
@DheerajDivaker
@DheerajDivaker Жыл бұрын
@@deviprasad_bal Toposort banega hi nahi, wo sirf DAG mein work karta hai.
@Anonymous_Coder
@Anonymous_Coder Жыл бұрын
@@DheerajDivaker Yes you are right but here since graph can be cyclic as well as acyclic , so incase of CYCLIC one edge which is causing cycle is not stored , like 1->2->3->1 , is only stored as [ 1, 2 ,3 ] . So ultimately we should not call it as a toposort ,but implementation is exactly same.
@DheerajDivaker
@DheerajDivaker Жыл бұрын
@@Anonymous_Coder yes absolutely correct.
@jaishriharivishnu
@jaishriharivishnu 5 ай бұрын
Note: we can't say this as a Topological sort(as topological sort using DFS will get you stuck in Loop i.e cycle), but its a bit different. Its topological Sort for the SCC.
@sathvikmalgikar2842
@sathvikmalgikar2842 9 ай бұрын
guys just in case any one wondering why that stack of dfs calls was required that is only if u r solving for the second case of actually printing the components and not just finding number of components. like based on the stack trace u can make a note of elements while popping and put them into groups and print
@vishalcheeti8374
@vishalcheeti8374 4 ай бұрын
without using stack, how to do solve the first case of finding no. of compo? I mean to find no. of components also we need it in sorted way right?
@amansingh.h716
@amansingh.h716 2 ай бұрын
@@vishalcheeti8374 we already reversed the graph so it will count the component for every dfs call,but somehow without stack its not working
@Parthj426
@Parthj426 3 ай бұрын
Understood after a little bit of effort.
@UECAshutoshKumar
@UECAshutoshKumar 10 ай бұрын
Thank you sir 🙏
@krishnavyaskondle5707
@krishnavyaskondle5707 Жыл бұрын
Thanks for Explaining the logic
@space_ace7710
@space_ace7710 Жыл бұрын
GFG compiler giving TLE, don't know why?? :(
@Mr_Cat_11
@Mr_Cat_11 2 жыл бұрын
Long time no see sir 😊 Thank you for posting 🥰🔥💖
@AmanKumar-wd2mq
@AmanKumar-wd2mq Жыл бұрын
You explain so well ❤❤
@kritikarawat2180
@kritikarawat2180 Жыл бұрын
Man, amazing explaination. Hats off to you buddy
@veekykumar4211
@veekykumar4211 2 жыл бұрын
great work sir i just watch ur few video and ur content is awesome
@bhavikpunmiya9641
@bhavikpunmiya9641 Жыл бұрын
Thanks for Explaining this concept :) really liked your explaination
@mr.dependable4885
@mr.dependable4885 2 жыл бұрын
Why is it important to reverse the edges, can't we just start the dfs in reverse order ? Like in the example start from 7 can any1 please explain
@arpitrajput6424
@arpitrajput6424 Жыл бұрын
we can't .try dryrun on 1st example , suppose u created vector which store the timing then timing will be {1 2 4 3 0} if you try dfs accoording to this you still cannot find scc.
@shivamsangwan7268
@shivamsangwan7268 Жыл бұрын
Yes, you can do that. But, this video is about Kosaraju's algorithm, which is implemented this way.
@wilhelmrudolphfittig3577
@wilhelmrudolphfittig3577 5 ай бұрын
maza aaala re ala striver aala
@249abhi
@249abhi Жыл бұрын
awesome explanation!
@UjjawalPathak-qy3uj
@UjjawalPathak-qy3uj 5 ай бұрын
HEY STRIVER, We can also reduce the time and steps if first getting there there finishing time and store in a queue rather then stack so because of FIFO we know first element to finish so we don't need to reverse the graph either we can directly go through the finishing elements which are already reverse with respect to graph it will reduce steps and clean code too. correct me if I m wrong
@Nirvanaattainer54
@Nirvanaattainer54 24 күн бұрын
yes you are wrong. on so many levels that it cant be fixed anymore.
@amitp277
@amitp277 Жыл бұрын
Awesome work 👏
@discuss1
@discuss1 7 ай бұрын
How do I pick the starting node for sorting. In the above example if we would have started sorting from Node 3, I would have never reached 0, 1, 2. So how to calculate this increasing time for all nodes efficiently.
@divyareddy7622
@divyareddy7622 2 жыл бұрын
thank you very muchhh! You've literally changed so many lives ✌️
@devanshubilthare5277
@devanshubilthare5277 Жыл бұрын
Amazing content🔥
@RISHABHKUMAR-w5z
@RISHABHKUMAR-w5z 4 ай бұрын
If you don't understand in one go just watch the video in 1x you will get better understanding slowly
@ronitkaushik4634
@ronitkaushik4634 3 ай бұрын
whats the problem in doing only reversing thr edges and dfs. why store them in first?
@sauravchandra10
@sauravchandra10 Жыл бұрын
Understood, thanks!
@paruldamahe7969
@paruldamahe7969 8 ай бұрын
amazing content!
@dhruvn6522
@dhruvn6522 Жыл бұрын
Sir is sorting edges according to finishing time same as topological sort?
@discuss1
@discuss1 7 ай бұрын
Will topological sort work in cyclic graphs?
@ravipatel-xu5qi
@ravipatel-xu5qi 8 ай бұрын
Why sorting is needed. Can't be simply reverse the edges and then do dfs on all the nodes. We can get group of nodes which are there in cycle which is ultimately our strongly connected components.
@lavanya_m01
@lavanya_m01 8 ай бұрын
By doing that you've completely ignored the "Finish time" concept. While doing the dfs in the transpose graph( with reverse edges) you should start with the component which does not have an edge going to the other scc.. that's why we use a stack and pop the top most element to perform dfs. If u want, I'll post my python code
@harshkumargupta8538
@harshkumargupta8538 29 күн бұрын
Please perform a dry run for the first example. Swap nodes 0 and 7, and then complete the dry run.
@no---on
@no---on 8 ай бұрын
In given example if we just make a little change with 3->2 then after reversing the edge will be 2->3 so in step 3 dfs call 2 will also go to 3 . I feel like it should not go to 3
@abhishekchoudhary7030
@abhishekchoudhary7030 8 ай бұрын
i have the same confusion that if we start with 7 in the start rather than 0 , we will get wrong connected components
@parshchoradia9909
@parshchoradia9909 Жыл бұрын
Understood Sir!
@hardikjain-brb
@hardikjain-brb 11 ай бұрын
The problem with graphs: The algos are easy code is easy dry run is easy chill But almost everytime this ques isnt answered Why this algo works like the basis of working of algorithms> Moreover this all is so volatile I'll forget this like in what 3 days>?
@ayushman_sr
@ayushman_sr 11 ай бұрын
thought process is very tricky
@vardhanbolla-kz7xe
@vardhanbolla-kz7xe Жыл бұрын
This code is giving tle in gfg, the below code is same as what you thought class Solution { private: void dfs(int node, vector &vis,vector adj,stack &st) { vis[node]=1; for(auto it: adj[node]) { if(vis[it]==0) { dfs(it,vis,adj,st); } } st.push(node); } void dfs1(int node, vector &vis, vector adjT[]) { vis[node]=1; for(auto it: adjT[node]) { if(vis[it]==0) { dfs1(it,vis,adjT); } } } public: //Function to find number of strongly connected components in the graph. int kosaraju(int V, vector& adj) { //code here vector vis(V,0); stack st; for(int i=0;i
@Lullurluli
@Lullurluli 11 ай бұрын
To resolve this issue, make sure that adjT is declared as a vector of vectors vectoradjT(V);
@muditkhanna8164
@muditkhanna8164 Жыл бұрын
please make videos on Eulerian paths also.
@dinoarmy2440
@dinoarmy2440 2 ай бұрын
A single dfs will work by using flag(fillStack) parameter....
@mathematics7746
@mathematics7746 Жыл бұрын
awsm explanation thank u so much
@-VLaharika
@-VLaharika Жыл бұрын
Understood 👍
@h6_wingers
@h6_wingers Жыл бұрын
mast padha dia bahiya
@AryanMathur-gh6df
@AryanMathur-gh6df Жыл бұрын
UNDERSTOOD
@sukhpreetsingh5200
@sukhpreetsingh5200 Жыл бұрын
Awesome thanks a lot
@divyatejaswinivengada6368
@divyatejaswinivengada6368 11 ай бұрын
Understooddd!!
@pavanrai6196
@pavanrai6196 Жыл бұрын
Can't we use queue and then not reversing the edges and just count no of scc of back, but it's not working idk
@DheerajDivaker
@DheerajDivaker Жыл бұрын
edges ko reverse karne se SCCs separate ho rahe hai..
@ritulraj6119
@ritulraj6119 Жыл бұрын
🔥🔥🔥🔥 Explanation
@manasranjanmahapatra3729
@manasranjanmahapatra3729 Жыл бұрын
Understood.
@nitinkumar5974
@nitinkumar5974 5 ай бұрын
thanks for the video
@adityavaste8963
@adityavaste8963 Жыл бұрын
Can we skip the step 1, and just reverse all the edges ? Because after reversing edges, components will be logically separated and we can run DFS on it separately, and can find the nodes in each component. Please can anyone guide me on this ?
@adityavaste8963
@adityavaste8963 Жыл бұрын
Ohh, got it. It's for the efficiency
@Jinxed192
@Jinxed192 Жыл бұрын
for eg, in the same example as striver's, if you reverse the edge between 2 & 3, with your process, when the graph is reversed, the dfs(0) has 3 as well in it, this is the loop hole. Whereas, in the algo, when we do dfs first and calculate finishing times, we get 3 at the top of the stack, so now we can make different dfs calls for each scc. Hope you understand. Have a great day!
@adityavaste8963
@adityavaste8963 Жыл бұрын
​@@Jinxed192 Thanks for explaination. That means we must know from where to start, to void futher conflicts.
@VISHALMISHRA-ff2ih
@VISHALMISHRA-ff2ih 3 ай бұрын
@@Jinxed192 the edge is like 0->1, 1->2 , 2->0 , 2->3 then how you are saying reversing the edges between 2->3 will be inside the dis(0)..And what Aditya is commenting is totally fine.
@visheshagrawal8676
@visheshagrawal8676 Жыл бұрын
amazing content
@ms-ej4gd
@ms-ej4gd 2 жыл бұрын
Big fan of your work striver
@suryakiran2970
@suryakiran2970 Жыл бұрын
Understood❤
@dumpster-jackson
@dumpster-jackson 7 ай бұрын
Understood!!
@iKnowThatSong
@iKnowThatSong 11 ай бұрын
Instate on transposing the graph, can't we just start from the last node? someone please explain....
@manojnavinjamuri5867
@manojnavinjamuri5867 Жыл бұрын
understood
@Kupo3.0
@Kupo3.0 Жыл бұрын
Understood!
@shorts_afx
@shorts_afx 2 жыл бұрын
Thanks buddy
@sharathkumar8338
@sharathkumar8338 2 жыл бұрын
Understood brother. Could you please upload videos on sliding window and 2 pointers?? I saw most amazon OA will be based on that only.
@saitejadamaraju5408
@saitejadamaraju5408 Жыл бұрын
Already there in the channel bro
@nikhil_squats
@nikhil_squats 3 ай бұрын
is first step similiar to topo sort?
@afraztanvir973
@afraztanvir973 Жыл бұрын
Is there any relation in this algo and topo sort as we get reverse topo from stack
@PalashAgrawalECE
@PalashAgrawalECE Жыл бұрын
19:55 Why did you mention to write as private function. Is there any advantage of it over public. As I tested in run time and got public working faster than private. Also from outer source noone is calling that dfs function. So kindly elaborate please
@GANESHSINGH-uc1gk
@GANESHSINGH-uc1gk 2 жыл бұрын
crystal clear
@tanmaybro3812
@tanmaybro3812 5 ай бұрын
Isn't the first step same as topological sort?
@anshkothariAK
@anshkothariAK 3 ай бұрын
Yes Bro its the same
@abhinavbhardwaj3372
@abhinavbhardwaj3372 Жыл бұрын
understood sir
@anishraj66
@anishraj66 Жыл бұрын
bhaiya can,t we solve it by reversing the stack instead of reversing the graph
@visheshagrawal8676
@visheshagrawal8676 Жыл бұрын
stack reversal will reverse the finish time but reversing the graph does not allow us to go from one scc to another scc
@nisanduathsara5242
@nisanduathsara5242 8 ай бұрын
understooood
@Rajat_maurya
@Rajat_maurya 2 жыл бұрын
why we need to sort, why can't we simply use ? for(int i=0;i
@jahanvichaudhary81
@jahanvichaudhary81 Жыл бұрын
same question
@rahulsangvikar7973
@rahulsangvikar7973 7 ай бұрын
Sorting makes you sure that you process those nodes first which lie at the end of a directed path. If you apply it randomly, you might start dfs from the start node or any node in the middle and will visit the nodes that are not a part of the SCC as well.
@amansingh.h716
@amansingh.h716 2 ай бұрын
@@rahulsangvikar7973 but we already reversed the nodes and its not connected anymore ,,,also we have visited array so we can ignore already processed node
@piyushacharya7696
@piyushacharya7696 2 жыл бұрын
reach++ Loved it
@subrahmanyammartha9531
@subrahmanyammartha9531 2 ай бұрын
@striver... is there really a need to reverse the graph...or the edges... After finding the finishing times and storing them....we could start dfs with the ascending order of finishing time....that would give us the 7th node first...then 6th....then 3rd and then 2nd..... this would give us 4 SCC and also the SCC ....may be just in a different order but still SCC
@adamyasharma_0135
@adamyasharma_0135 9 ай бұрын
amazing..
@mriduljain6809
@mriduljain6809 Жыл бұрын
Understood
@danushbasanaboyina1306
@danushbasanaboyina1306 5 ай бұрын
In the first step.sorting all the edges ...looks like topological sorting..... Is it the same I am thinking....
@tomorrowcut
@tomorrowcut 3 ай бұрын
Topological Sort can only to applied to DAG
@herculean6748
@herculean6748 Жыл бұрын
Thanks🙌
@mannmehta4841
@mannmehta4841 Ай бұрын
Sorting nodes with there finishing time it's nothing but a topo sort.
@rishabhgupta9846
@rishabhgupta9846 Жыл бұрын
Didn't get why are we storing the nodes in stack.
@subhambhakat3908
@subhambhakat3908 Жыл бұрын
To take out the first node.Then to reach the second third and 4th component in order
@AbsolutePain
@AbsolutePain Жыл бұрын
Topo sort using dfs........
@sahiljaiswal9270
@sahiljaiswal9270 Жыл бұрын
I am confused about the first step of arranging nodes on their finishing times. I thought that instead just doing normal DFS on reversed graph skipping the first step might also work but it doesnt, Can anyone explain this with an example
@harshitpant07
@harshitpant07 Жыл бұрын
if you reversed the graph and then perform the dfs how will you be able to reach form[0,1,2] --> [3] so to tackle this we store them in a stack to remember their order form start to finish .
@ranvijaysharma6697
@ranvijaysharma6697 5 ай бұрын
sort all nodes according to finishing time... toposort kehne me kya jaa rha.
G-56. Articulation Point in Graph
22:00
take U forward
Рет қаралды 106 М.
ТВОИ РОДИТЕЛИ И ЧЕЛОВЕК ПАУК 😂#shorts
00:59
BATEK_OFFICIAL
Рет қаралды 6 МЛН
Long Nails 💅🏻 #shorts
00:50
Mr DegrEE
Рет қаралды 14 МЛН
Strongly Connected Components Kosaraju's Algorithm Graph Algorithm
24:30
Tushar Roy - Coding Made Simple
Рет қаралды 227 М.
G-53. Most Stones Removed with Same Row or Column - DSU
23:51
take U forward
Рет қаралды 111 М.
G-46. Disjoint Set | Union by Rank | Union by Size | Path Compression
42:15
5 Math Skills Every Programmer Needs
9:08
Sahil & Sarra
Рет қаралды 1,1 МЛН
Kosaraju Algorithm | Strongly connected components in a graph
24:30
How I would learn Leetcode if I could start over
18:03
NeetCodeIO
Рет қаралды 688 М.
G-11. Detect a Cycle in an Undirected Graph using BFS | C++ | Java
20:19
ТВОИ РОДИТЕЛИ И ЧЕЛОВЕК ПАУК 😂#shorts
00:59
BATEK_OFFICIAL
Рет қаралды 6 МЛН