Skip to content
Snippets Groups Projects
Commit b831b103 authored by Martin Mareš's avatar Martin Mareš
Browse files

Range tree: Fixed a comment

parent 3e8ac681
Branches
No related tags found
No related merge requests found
...@@ -148,7 +148,7 @@ class Tree { ...@@ -148,7 +148,7 @@ class Tree {
} }
} }
// Return number of elements in range [left, right]. // Return the sum of elements with keys in range [left, right].
// //
// Given a closed range [left, right], return the sum of values of elements // Given a closed range [left, right], return the sum of values of elements
// in the range, i.e., sum(value | (key, value) in tree, left <= key <= right). // in the range, i.e., sum(value | (key, value) in tree, left <= key <= right).
......
...@@ -121,7 +121,7 @@ class Tree: ...@@ -121,7 +121,7 @@ class Tree:
right.parent = self.root right.parent = self.root
def range_sum(self, left, right): def range_sum(self, left, right):
"""Return number of elements in range [left, right] """Return the sum of elements with keys in range [left, right]
Given a closed range [left, right], return the sum of values of elements Given a closed range [left, right], return the sum of values of elements
in the range, i.e., sum(value | (key, value) in tree, left <= key <= right). in the range, i.e., sum(value | (key, value) in tree, left <= key <= right).
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment