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

Function inorder

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

Source from the content-addressed store, hash-verified

328}
329
330fn inorder<T, U>(bst: Link<T,U>)
331where T: Copy + Ord + Debug,
332 U: Copy + Debug
333{
334 if !bst.is_none() {
335 inorder(bst.as_ref().unwrap().get_left());
336 println!("key: {:?}, val: {:?}", bst.as_ref().unwrap().key.unwrap(), bst.as_ref().unwrap().val.unwrap());
337 inorder(bst.as_ref().unwrap().get_right());
338 }
339}
340
341fn postorder<T, U>(bst: Link<T,U>)
342where 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