new_tree_list = [] for tree in tree_list: if tree is not None: yield tree.value new_tree_list.append(tree.left) new_tree_list.append(tree.right) tree_list
Courcelle, B., The monadic second-order logic of graphs I: Recognizable sets of finite graphs, Information and Computation, 1990, 85: 12–75, CiteSeerX 10.1.1
Turner, J. S., The vertex separation and search number of a tree, Information and Computation, 1994, 113 (1): 50–79, doi:10.1006/inco.1994.1064 . Feige