public final FluentIterable < T > breadthFirstTraversal ( final T root ) { checkNotNull ( root ) ; return new FluentIterable < T > ( ) { @ Override public UnmodifiableIterator < T > iterator ( ) { return new BreadthFirstIterator ( root ) ; } } ; }
Returns an unmodifiable iterable over the nodes in a tree structure using breadth - first traversal . That is all the nodes of depth 0 are returned then depth 1 then 2 and so on .