Generating all free rooted (non-isomorphic) trees algorithm