MCPcopy Create free account
hub / github.com/algorithm-archivists/algorithm-archive / main

Function main

contents/tree_traversal/code/rust/tree.rs:78–101  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

76}
77
78fn main() {
79 let root = create_tree(2, 3);
80
81 println!("[#]\nRecursive DFS:");
82 dfs_recursive(&root);
83 println!();
84
85 println!("[#]\nRecursive Postorder DFS:");
86 dfs_recursive_postorder(&root);
87 println!();
88
89 println!("[#]\nStack-based DFS:");
90 dfs_stack(&root);
91 println!();
92
93 println!("[#]\nQueue-based BFS:");
94 bfs_queue(&root);
95 println!();
96
97 println!("[#]\nRecursive Inorder DFS for Binary Tree:");
98 let root_binary = create_tree(3, 2);
99 dfs_recursive_inorder_btree(&root_binary);
100 println!();
101}

Callers

nothing calls this directly

Calls 6

create_treeFunction · 0.70
dfs_recursiveFunction · 0.70
dfs_recursive_postorderFunction · 0.70
dfs_stackFunction · 0.70
bfs_queueFunction · 0.70

Tested by

no test coverage detected