Sometimes when we search a bout trees problems ... We get problems that contain queries but with trees I think that this problems have a good tricks and so hard to find these trick so if anyone have an idea about how to solve problems that contain trees and queries .. pls give me resource how to learn and problems to solve and thanks for all and sorry for bad english .
You can learn how to solve this kind of problems by learning Euler tour technique, but you must be familiar with segment tree, there are many other techniques that can solve trees queries but this is so powerful and simple enough to start with.
https://usaco.guide/gold/tree-euler
You can learn it from here.
if you don't know segment tree you can learn it from here as well.
https://usaco.guide/gold/PURS
https://cp-algorithms.com/data_structures/segment_tree.html
and there are many resources, just try to search on youtube if you can't understand them
Thanks so much bro .. I will start learning Euler tour . Good luck , and thanks again .
You're more than welcome :)