Skip to content

Commit c5264c8

Browse files
committed
docs: improve wording
1 parent 061dd1d commit c5264c8

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

src/main/java/dataStructures/segmentTree/SegmentTree.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,7 @@ public int query(int leftEnd, int rightEnd) {
6666
private int query(SegmentTreeNode node, int leftEnd, int rightEnd) {
6767
// this is the case when:
6868
// start end
69-
// range query: ^ ^ --> so simply capture the sum at this node!
69+
// range query: ^ ^ --> so simply capture the sum at this node!
7070
if (leftEnd <= node.start && node.end <= rightEnd) {
7171
return node.sum;
7272
}
@@ -101,7 +101,7 @@ public void update(int idx, int val) {
101101

102102
private void update(SegmentTreeNode node, int idx, int val) {
103103
if (node.start == node.end && node.start == idx) {
104-
node.sum = val; // previously, node held a single value; now updated
104+
node.sum = val; // node is holding a single value; now updated
105105
return;
106106
}
107107
int mid = node.start + (node.end - node.start) / 2;

src/main/java/dataStructures/segmentTree/arrayRepresentation/SegmentTree.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@ public int query(int leftEnd, int rightEnd) {
5454
private int query(int nodeIdx, int startRange, int endRange, int leftEnd, int rightEnd) {
5555
// this is the case when:
5656
// start end
57-
// range query: ^ ^ --> so simply capture the sum at this node!
57+
// range query: ^ ^ --> so simply capture the sum at this node!
5858
if (leftEnd <= startRange && endRange <= rightEnd) {
5959
return tree[nodeIdx];
6060
}

0 commit comments

Comments
 (0)