Segment Tree
Intro
Definition
private class Interval {
int start, end;
public Interval(int start, int end) {
this.start = start;
this.end = end;
}
}
private class TreeNode {
TreeNode leftChild;
TreeNode rightChild;
Interval intv;
Data data;
public TreeNode(Interval intv, Data data) {
this.intv = intv;
this.data = data;
}
}Build (LC.201)
Query (LC.202)
Modify (LC.203)
References
Last updated