Tree: , . Values: . After DFS: tin = [0, 1, 2, 5], tout = [7, 4, 3, 6]. BIT: arr[0] = +4, arr[7] = -4, arr[1] = +2, arr[4] = -2, arr[2] = +1, arr[3] = -1, arr[5] = +5, arr[6] = -5. Path to node : prefix sum to tin[4] = 2 is .
Update node to : add delta at positions and . Now path to sums to . Breaking paths into these ranges lets you use data structures designed for array operations.