Trait cp_library_rs::utils::show_binary_tree::ShowBinaryTree
source · 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§
sourcefn print_node(&mut self, ptr: &P) -> String
fn print_node(&mut self, ptr: &P) -> String
<required> ノードの値を表示する
Provided Methods§
sourcefn print_inner(
&mut self,
ptr: P,
fill: &mut Vec<&'static str>,
last: &'static str
)
fn print_inner( &mut self, ptr: P, fill: &mut Vec<&'static str>, last: &'static str )
再帰的にprintを行う
sourcefn print_as_binary_tree(&mut self)
fn print_as_binary_tree(&mut self)
2分木としてフォーマットする