(bst: Link<T,U>)
| 339 | } |
| 340 | |
| 341 | fn postorder<T, U>(bst: Link<T,U>) |
| 342 | where 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 | |
| 352 | fn levelorder<T, U>(bst: Link<T,U>) |
| 353 | where T: Copy + Ord + Debug, |