You are given a tree with nodes. Implement a class that supports queries. This is exactly the binary lifting problem, but in an object-oriented wrapper.
You will build the table in the constructor, then answer queries. Constraints: , up to queries. Binary lifting handles this easily. The constructor runs in and each query takes time.