MCPcopy Create free account
hub / github.com/QMHTMY/RustBook / inorder

Function inorder

publication/code/chapter08/binary_tree.rs:298–304  ·  view source on GitHub ↗
(bt: Link<T>)

Source from the content-addressed store, hash-verified

296}
297
298fn inorder<T: Clone + Ord + ToString + Debug>(bt: Link<T>) {
299 if !bt.is_none() {
300 inorder(bt.as_ref().unwrap().get_left());
301 println!("key: {:?}", bt.as_ref().unwrap().get_key());
302 inorder(bt.as_ref().unwrap().get_right());
303 }
304}
305
306fn postorder<T: Clone + Ord + ToString + Debug>(bt: Link<T>) {
307 if !bt.is_none() {

Callers 1

orderFunction · 0.70

Calls 2

get_leftMethod · 0.45
get_rightMethod · 0.45

Tested by

no test coverage detected