Bentley Systems interview question

Traverse a tree both iteratively and recursively.