pub fn new(mut init: Vec<T::M>) -> Self {
        let size = init.len();
        let mut t = (0..size).map(|_| T::identity()).collect::<Vec<_>>();
        t.append(&mut init);
        for i in (0..size).rev() {
            t[i] = T::op(&t[i << 1], &t[i << 1 | 1]);
        }
        Self {
            d: vec![None; size],
            t,
        }
    }
/// Initializes a static balanced tree on top of the given sequence.
Initializes a static balanced tree on top of the given sequence.
Initializes a static balanced tree on top of the given sequence .
pub fn new(mut init: Vec<T::M>) -> Self {
        let size = init.len();
        let mut t = (0..size).map(|_| T::identity()).collect::<Vec<_>>();
        t.append(&mut init);
        for i in (0..size).rev() {
            t[i] = T::op(&t[i << 1], &t[i << 1 | 1]);
        }
        Self {
            d: vec![None; size],
            t,
        }
    }
pub fn new ( mut init : Vec < T :: M > ) -> Self { let size = init . len ( ) ; let mut t = ( 0 .. size ) . map ( | _ | T :: identity ( ) ) . collect :: < Vec < _ > > ( ) ; t . append ( & mut init ) ; for i in ( 0 .. size ) . rev ( ) { t [ i ] = T :: op ( & t [ i << 1 ] , & t [ i << 1 | 1 ] ) ; } Self { d : vec ! [ None size ] , t , } }
Initializes a static balanced tree on top of the given sequence.
Initializes a static balanced tree on top of the given sequence .
init
Vec<T::M>
init
Vec<T::M>