iterator pattern if __name__ ="__main__"tree mytree(node( )tree add_node(node( )tree add_node(node( )tree add_node(node( )tree add_node(node( )tree add_node(node( )tree add_node(node( )tree add_node(node( )tree add_node(node( )for in treeprint(iprint("maximum value{}format(max(tree))print("total of values{}format(sum(tree))as you would expectthe results are as follows maximum value total of values the algorithms for each of these constructs were implemented completely decoupled of the data types that would later use them interestingly enoughyou can create list object that is iterable using list comprehension (which is almost like shorthand for creating iterable objectsas aboveonly the if statement is changedso once again will only include the code for the if and the code needed to transform the tree into list