Thanks for your positive feedback sir
@admin , why does it say āasked n days ago by kurumaā shouldnāt it rather say āposted n days ago by kurumaā ? btw @Kuruma, really nice and helpful post
GALACTICK could be solved using Disjoint Sets data structure instead of DFS and BFS. This would have sped up the code by many times
Thank you @v_akshay, Iām glad you liked this About the asked vs posted part, as this was a āquestionā, it says asked, but, I guess that is just how the forums work
Nice work kurumaā¦keep it up.It was written in a neat and crisp way.This tutorial was required by many newbies. One can expect people implementing this tutorialās code from the next contests
Thank you very much for the positive feedback @re_hash! I hope I can implement all these ideas in next contests myself as well
Awesome post !! Easy to understand and really good for a beginner . .
I tried my hand on implementing some of the graph algorithms in python and Iāve uploaded it on github link , if someone wants to go through them , its available . It might be a bit messy though , Iāve tried my best to make it look good and readable . Hope it helps !!
to ADMIN staff, pls pin algo tutorials like these on static algo tutorials page. topcoder has that
Do we have a āstatic algo tutorials pageā here on Discuss? The closest thing seems to be the tutorials and references posted at Codechef for Schools page, but, if we could pin a āsub-forumā grouping all tutorials or even better all editorials on its own āsub-forumsā, that would be really useful
I solved the problem first by Disjoint Sets and then by DFS. Learned a lot about DFS from GALACTIK that helped me in FEB14 in solving DRGHTS.
Have a look at this blog it contains nice stuff on graphs and treesā¦
i am not getting what is sz_connct_compt is? could u please explain me?
The best Explanation of Graphs, I have seen so far.
I did not attempted the Graph Problems, as I was thinking that it was not my cup of cake, but now I will try it.
Thanks @kuruma
It tells that a particular friend has sz_connct_compt number of connected friends.
Means, if 1->2 and 2->3 and 3->5,6
so when we dfs(1) the sz_connct_compt will become 5, as there are 5 friends that will be liking to escape by same route.
I hope now you have understood. @amanjain7793
Tanq so much
@kuruma Could you explain how you calculate the number of ways to select the captains? I didnāt understand that part.
Nice tutorial, made DFS so clear as you used it to solve a problem, This is a great help for beginners please continue this kind of tutorials.
following link is be very useful for u to understand binary tree traversal(pre-order, in-order, post-order) in detail including graphs: