Collects all the visited nodes of type T into a collection.
an ordered list (DFS order) containing all the visited nodes of type T in the tree
node type