Node is an ancestor of if DFS entered before and exited after . Condition: tin[u] <= tin[v] and tout[v] <= tout[u]. Check both inequalities in time. This is faster than LCA for simple ancestor queries. No extra data structures needed, and arrays.
This property makes it easy to check relationships between nodes without walking the tree. This check runs in time. No tree traversal needed. Compare two pairs of numbers and you get the answer.
Space complexity is for the data structures used.