Pause here. Ask yourself: what type of query is this? Is it asking about a subtree, a path, or an ancestor relationship?
How many queries are there? Can you answer each query in time by walking the tree, or do you need faster lookups with preprocessing?
Also consider: are there updates to the tree structure or node values? Or is the tree static after it is built?
Try to identify the technique before reading on. I'll reveal the answer in the next unit.