‣ SeriallyEvaluateRecursiveIterator ( iter ) | ( function ) |
Returns: an iterator of leaves.
Serially evaluate the recursive iterator iter. The produced leaves are then returned in a usual iterator.
This example enumerates all full binary trees with 9 leaves. The number is the sixth Catalan number.
gap> ReadPackage( "ParallelizedIterators", "examples/CatalanIterator.g" ); true gap> n := 9; 9 gap> riter := IteratorCatalanTree( [[ 1 .. n ]], [[ 1 ]] ); <iterator> gap> liter := SeriallyEvaluateRecursiveIterator( riter ); <iterator> gap> i := 0; 0 gap> while not IsDoneIterator( liter ) do NextIterator( liter ); i:=i+1; od; gap> i; 1430
generated by GAPDoc2HTML