We use cookies to ensure you have the best browsing experience on our website. Please read our cookie policy for more information about how we use cookies.
Just count the subtree size of each node and if it contains even nodes including itself, increment the count. It indicates it should have a cut.
Below is the java code
Even Tree
You are viewing a single comment's thread. Return to all comments →
Just count the subtree size of each node and if it contains even nodes including itself, increment the count. It indicates it should have a cut. Below is the java code