Skip to main content

print_tree_iterative

Function print_tree_iterative 

Source
pub fn print_tree_iterative(
    tree: &BTreeMap<String, Box<Tree>>,
    initial_depth: usize,
)
Expand description

Prints the tree structure with indentation based on depth (ITERATIVE VERSION)

Uses an explicit stack to avoid recursion while keeping the order of print_tree.

ยงArguments

  • tree - The tree to print
  • initial_depth - Depth level of the first line for indentation