Struct louds::Louds [−][src]
pub struct Louds(_);
Methods
impl Louds
[src]
impl Louds
pub fn new() -> Louds
[src]
pub fn new() -> Louds
Returns an empty LOUDS tree.
pub fn push_node(&mut self, d: usize)
[src]
pub fn push_node(&mut self, d: usize)
Push a node which has d
children.
pub fn push_bit(&mut self, b: bool)
[src]
pub fn push_bit(&mut self, b: bool)
Push a bit.
pub fn size(&self) -> usize
[src]
pub fn size(&self) -> usize
pub fn first_child(&self, i: usize) -> Option<usize>
[src]
pub fn first_child(&self, i: usize) -> Option<usize>
Returns the first child of the i-th node in breadth-first order.
pub fn last_child(&self, i: usize) -> Option<usize>
[src]
pub fn last_child(&self, i: usize) -> Option<usize>
Returns the last child of the i-th node in breadth-first order.
pub fn is_leaf(&self, i: usize) -> bool
[src]
pub fn is_leaf(&self, i: usize) -> bool
Returns true
if the i-th node is a leaf node (has no children).
pub fn degree(&self, i: usize) -> usize
[src]
pub fn degree(&self, i: usize) -> usize
Returns the degree (# of children) of the i-th node.
pub fn range_children(&self, i: usize) -> Option<(usize, usize)>
[src]
pub fn range_children(&self, i: usize) -> Option<(usize, usize)>
Returns the range (s, e)
of children of the i-th node.
The first value s
corresponds to the first child,
and e
corresponds to the last child.
l.range_children()
is equivalent to (l.first_child(), l.last_child())
but
range_children
is faster.
pub fn sibling(&self, i: usize) -> Option<usize>
[src]
pub fn sibling(&self, i: usize) -> Option<usize>
Returns the next sibling of the i-th node.
pub fn child(&self, i: usize, k: usize) -> Option<usize>
[src]
pub fn child(&self, i: usize, k: usize) -> Option<usize>
Returns the k-th child of the i-th node.
pub fn parent(&self, i: usize) -> Option<usize>
[src]
pub fn parent(&self, i: usize) -> Option<usize>
Returns the parent of the i-th node.
pub fn depth(&self, i: usize) -> usize
[src]
pub fn depth(&self, i: usize) -> usize
Returns the depth of the node i
.