LevelOrderTreeIterator

Tree is iterated by using `Level-order Traversal Algorithm" In level-order traversal we iterating nodes level by level, starting from root, and going deeper and deeper in tree.

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

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

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>