Given a tree with nodes, each with a value. Process queries:
Update: change node 's value to
Query: return the sum of values in 's subtree Constraints: . You've found the perfect Euler tour problem. Subtree becomes a range. Point update on node becomes point update on tour. Subtree sum becomes range sum.