Skip to content
Merged

nit #102

Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 1 addition & 4 deletions src/data_structures/lazy_seg_tree.rs
Original file line number Diff line number Diff line change
Expand Up @@ -51,11 +51,8 @@ impl LazySegTree {
/// - Space: O(n)
pub fn build_on_array(a: &[u64]) -> Self {
let n = a.len();
let mut pw2 = 1;
while pw2 < n {
pw2 *= 2;
}
let mut tree = vec![0; 2 * n];
let pw2 = n.next_power_of_two();
for i in 0..n {
tree[(i + pw2) % n + n] = a[i];
}
Expand Down
Loading