pub trait ShowBinaryTree<P> {
    // Required methods
    fn get_left(&mut self, ptr: &P) -> Option<P>;
    fn get_right(&mut self, ptr: &P) -> Option<P>;
    fn get_root(&mut self) -> P;
    fn print_node(&mut self, ptr: &P) -> String;

    // Provided methods
    fn print_inner(
        &mut self,
        ptr: P,
        fill: &mut Vec<&'static str>,
        last: &'static str
    ) { ... }
    fn print_as_binary_tree(&mut self) { ... }
}
Expand description

2分木を整形して表示する

Required Methods§

source

fn get_left(&mut self, ptr: &P) -> Option<P>

<required> 左の子のポインタを取得する

source

fn get_right(&mut self, ptr: &P) -> Option<P>

<required> 右の子のポインタを取得する

source

fn get_root(&mut self) -> P

<required> 根を取得する

source

fn print_node(&mut self, ptr: &P) -> String

<required> ノードの値を表示する

Provided Methods§

source

fn print_inner( &mut self, ptr: P, fill: &mut Vec<&'static str>, last: &'static str )

再帰的にprintを行う

source

fn print_as_binary_tree(&mut self)

2分木としてフォーマットする

Implementors§