I read your this Blog on DSU on trees.
Now, I have a doubt.
Given a tree with n nodes and each node has some color c[i], following query needs to be answered
1 x y: change color of node x to y
2 u c: count all the nodes with color c in subtree of u.
How to approach this??
Thanks for help in advance.