MCPcopy Create free account
hub / github.com/TheAlgorithms/Rust / update

Method update

src/data_structures/fenwick_tree.rs:61–73  ·  view source on GitHub ↗

Updates the tree by adding a value to the element at a specified index. This operation also propagates the update to subsequent elements in the tree. # Arguments `index` - The zero-based index where the value should be added. `value` - The value to add to the element at the specified index. # Returns A `Result` indicating success (`Ok`) or an error (`FenwickTreeError::IndexOutOfBounds`) if th

(&mut self, index: usize, value: T)

Source from the content-addressed store, hash-verified

source not stored for this graph (policy: none)

Callers 1

setMethod · 0.45

Calls 2

lowbitFunction · 0.85
lenMethod · 0.45

Tested by

no test coverage detected