Algorithm 6 Binary Tree Traversal Nonrecursive with Constant Space
Require: a binary tree
Ensure: print all keys appearing in
1:
2:
3:while do
4:if then // is
5:print
6:
7:if then
8:
9:else if then
10:
11:else
12:
13:end if
14:else if and then
15:
16:
17:else
18:
19:
20:end if
21:end while