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

Function postorder

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

Source from the content-addressed store, hash-verified

304}
305
306fn postorder<T: Clone + Ord + ToString + Debug>(bt: Link<T>) {
307 if !bt.is_none() {
308 postorder(bt.as_ref().unwrap().get_left());
309 postorder(bt.as_ref().unwrap().get_right());
310 println!("key: {:?}", bt.as_ref().unwrap().get_key());
311 }
312}
313
314fn levelorder<T: Clone + Ord + ToString + Debug>(bt: Link<T>) {
315 if bt.is_none() { return; }

Callers 1

orderFunction · 0.70

Calls 2

get_leftMethod · 0.45
get_rightMethod · 0.45

Tested by

no test coverage detected