Any one share best resources to master trees @cubefreak777
Are you asking for Theory or practice problems ?
Assuming that you’re starting from scratch:
- Firstly start off by learning about how to represent trees by Adjacency Lists & Matrices
- Then Learn about basic searches BFS and DFS. And then spend a significant amount of time in learning how to manipulate these searches specific to the problem at hand, it’s totally pointless to move on to other fancy algorithms unless you’re super strong at this. Solve as many problems as you can to get good as this, you can start solving problems from here. Learn about how find Diameter of a Tree. It should be a quick read.
- Now once you feel comfortable enough with bfs and dfs manipultation learn about Binary Lifting you can also check the RMQ Implementation if you’re interested. L
- Learn about Tree flattening & Euler tours [Pre-req: Fenwick Trees & Segment Trees].
- Now once we’re here you should be able solve almost all problems of CSES Tree Section.
- Then learn about DP on trees[Pre-req: Basic DP].
- Then study Centroid Decomposition from this cf blog.
Apart from these if you prefer video tutorials then you can go through these videos and mashups by SecondThread and galen_colin.
Algorithms Thread by SecondThread
Topic Stream by galen_colin
I might have missed out on some stuff, will update this post whenever I find something worth adding.
Thanks a lot😊 @cubefreak777