fn next_empty_depth(&self) -> usize {
        let mut skip = self.filled_subtree_roots.len();

        if self.tree.left.is_none() {
            if skip == 0 {
                return 0;
            }
            skip -= 1;
        }

        if self.tree.right.is_none() {
            if skip == 0 {
                return 0;
            }
            skip -= 1;
        }

        let mut depth = 1;
        for p in &self.tree.parents {
            if p.is_none() {
                if skip == 0 {
                    return depth;
                }
                skip -= 1;
            }
            depth += 1;
        }

        depth + skip
    }
/// Helper function for finding the next depth of an unfilled subtree.
Helper function for finding the next depth of an unfilled subtree.
Helper function for finding the next depth of an unfilled subtree .
fn next_empty_depth(&self) -> usize {
        let mut skip = self.filled_subtree_roots.len();
        if self.tree.left.is_none() {
            if skip == 0 {
                return 0;
            }
            skip -= 1;
        }
        if self.tree.right.is_none() {
            if skip == 0 {
                return 0;
            }
            skip -= 1;
        }
        let mut depth = 1;
        for p in &self.tree.parents {
            if p.is_none() {
                if skip == 0 {
                    return depth;
                }
                skip -= 1;
            }
            depth += 1;
        }
        depth + skip
    }
fn next_empty_depth ( & self ) -> usize { let mut skip = self . filled_subtree_roots . len ( ) ; if self . tree . left . is_none ( ) { if skip == 0 { return 0 ; } skip -= 1 ; } if self . tree . right . is_none ( ) { if skip == 0 { return 0 ; } skip -= 1 ; } let mut depth = 1 ; for p in & self . tree . parents { if p . is_none ( ) { if skip == 0 { return depth ; } skip -= 1 ; } depth += 1 ; } depth + skip }
Helper function for finding the next depth of an unfilled subtree.
Helper function for finding the next depth of an unfilled subtree .
&self
&self