IndexTree(树状数组)
文章平均质量分 78
线段树的小弟~
爱敲代码的Harrison
种一棵树最好的时间是十年前,其次是现在。
展开
-
IndexTree2D——二维区域和检索 - 可变(前缀和)
package com.harrison.class22;/** * @author Harrison * @create 2022-04-02-9:58 * @motto 众里寻他千百度,蓦然回首,那人却在灯火阑珊处。 */// 测试链接:https://leetcode.com/problems/range-sum-query-2d-mutable// 但这个题是付费题目// 提交时把类名、构造函数名从Code02_IndexTree2D改成NumMatrixpublic clas原创 2022-04-02 10:14:39 · 229 阅读 · 0 评论 -
IndexTree
package com.harrison.class22;/** * @author Harrison * @create 2022-04-02-9:39 * @motto 众里寻他千百度,蓦然回首,那人却在灯火阑珊处。 */public class Code01_IndexTree { // 下标从1开始 public static class IndexTree{ private int[] tree; private int N;原创 2022-04-02 09:58:03 · 319 阅读 · 0 评论