public static < T > void inOrder ( T root , BinTreeNavigator < T > binTreeNav , Action < T > action ) { for ( Iterator < T > it = inOrder ( root , binTreeNav ) ; it . hasNext ( ) ; ) { T treeVertex = it . next ( ) ; action . action ( treeVertex ) ; } }
Executes an action on all nodes from a tree in inorder . For trees with sharing the same tree node object will be visited multiple times .