Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

pro-30/Tree-Algorithms

Repository files navigation

Tree-Algorithms

My solution to all the CSES Tree Algorithms Problems.

Problems available at : https://cses.fi/problemset/list/

  1. Subordinates : Dynamic Programming to calculate subtree size rooted at each node.

  2. Tree Matching : Dynamic Programming on Trees.

  3. Tree Diameter : 1st solution based on Proof of Diameter. 2nd using Dynamic Programming on Trees where we try all possible paths.

  4. Tree Distances I : Dynamic Programming on Trees + Rerooting Technique.

  5. Tree Distances II : Dynamic Programming on Trees + Rerooting Technique.

  6. Company Queries I : Binary Lifting(which in itself is a Dynamic Programing Approach).

  7. Company Queries II : Answer LCA queries in O(logn) Time Using Binary Lifting . (Note: Binary Search + Binary Lifting Will give TLE because it will be O(log2n) per query ).

  8. Distance Queries : Binary Lifting.

About

My solution to all the CSES Tree Algorithms Problems.

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

AltStyle によって変換されたページ (->オリジナル) /