Description Usage Format Examples
Methods:
new(init)
Initializes from a vector init.
update(location, new.val)
Replaces the item at location with new.val.
query(l, r)
Returns the sum of the interval [l, r].
show.BIT ()
Returns the Binary Indexed Tree.
show.origin()
Returns the vector.
1 |
An object of class R6ClassGenerator
of length 24.
1 2 3 4 5 | tmp <- BinaryIndexedTree$new(c(2,3,2,5,1))
tmp$update(1,3)
tmp$query(1,5)
tmp$show.origin()
tmp$show.BIT()
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.