@@ -0,0 +1,1110 @@
+/**%0A * Definition of SegmentTreeNode:%0A * public class SegmentTreeNode %7B%0A *     public int start, end, max;%0A *     public SegmentTreeNode left, right;%0A *     public SegmentTreeNode(int start, int end, int max) %7B%0A *         this.start = start;%0A *         this.end = end;%0A *         this.max = max%0A *         this.left = this.right = null;%0A *     %7D%0A * %7D%0A */%0A%0Apublic class Solution %7B%0A    /**%0A     * @param root: The root of segment tree.%0A     * @param index: index.%0A     * @param value: value%0A     * @return: nothing%0A     */%0A    public void modify(SegmentTreeNode root, int index, int value) %7B%0A        // write your code here%0A        if(root.start == index && root.end == index) %7B // %E6%9F%A5%E6%89%BE%E5%88%B0%0A            root.max = value;%0A            return;%0A        %7D%0A        %0A        // %E6%9F%A5%E8%AF%A2%0A        int mid = (root.start + root.end) / 2;%0A        if(root.start %3C= index && index %3C=mid) %7B%0A            modify(root.left, index, value);%0A        %7D%0A        %0A        if(mid %3C index && index %3C= root.end) %7B%0A            modify(root.right, index, value);%0A        %7D%0A        //%E6%9B%B4%E6%96%B0%0A        root.max = Math.max(root.left.max, root.right.max);%0A    %7D%0A%7D

add 203