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

Function postorder

publication/code/chapter08/bst.rs:341–350  ·  view source on GitHub ↗
(bst: Link<T,U>)

Source from the content-addressed store, hash-verified

339}
340
341fn postorder<T, U>(bst: Link<T,U>)
342where T: Copy + Ord + Debug,
343 U: Copy + Debug
344{
345 if !bst.is_none() {
346 postorder(bst.as_ref().unwrap().get_left());
347 postorder(bst.as_ref().unwrap().get_right());
348 println!("key: {:?}, val: {:?}", bst.as_ref().unwrap().key.unwrap(), bst.as_ref().unwrap().val.unwrap());
349 }
350}
351
352fn levelorder<T, U>(bst: Link<T,U>)
353where T: Copy + Ord + Debug,

Callers 1

orderFunction · 0.70

Calls 2

get_leftMethod · 0.45
get_rightMethod · 0.45

Tested by

no test coverage detected