CodingHard
Process node value updates and subtree sum queries on a tree
Filed under Directi
The question
Given a tree with n nodes represented by a parent array, process q queries that include adding values to a single node, adding values to all nodes on the path from root to a node, querying the value of a single node, and querying the sum of values in a subtree.
No write-up yet. Related questions below have one.
Related Directi questions
Collected from public candidate posts and coding forums. Updated Nov 2026.