PreOrderTreeIterator

Tree is iterated by using `Pre-order Traversal Algorithm" The pre-order traversal is a topologically sorted one, because a parent node is processed before any of its child nodes is done.

E.g.
1
/ | \
/ | \
2 3 4
/ \ / | \
5 6 7 8 9
/ / | \
10 11 12 13

Output: 1 2 5 10 6 11 12 13 3 4 7 8 9

Constructors

Link copied to clipboard
constructor(root: TreeNode<T>)

Functions

Link copied to clipboard
open operator override fun hasNext(): Boolean
Link copied to clipboard
open operator override fun next(): TreeNode<T>