figure small tree list of lists representation in tree represented by list of listswe will begin with python' list data structure and write the functions defined above although writing the interface as set of operations on list is bit different from the other abstract data types we have implementedit is interesting to do so because it provides us with simple recursive data structure that we can look at and examine directly in list of lists treewe will store the value of the root node as the first element of the list the second element of the list will itself be list that represents the left subtree the third element of the list will be another list that represents the right subtree to illustrate this storage techniquelet' look at an example figure shows simple tree and the corresponding list implementation my_tree [' '#root [' '#left subtree [' [][]][' [][]][' '#right subtree [' [][]][notice that we can access subtrees of the list using standard list indexing the root of the tree is my_tree[ ]the left subtree of the root is my_tree[ ]and the right subtree is my_tree[ the code below illustrates creating simple tree using list once the tree is constructedwe can access the root and the left and right subtrees one very nice property of this list of lists approach is that the structure of list representing subtree adheres to the structure defined for treethe structure itself is recursivea subtree that has root value and two empty lists is leaf node another nice feature of the list of lists approach is that it generalizes to tree that has many subtrees in the case where the tree is more than binary treeanother subtree is just another list my_tree [' '[' '[' ',[],[]][' ',[],[]][' '[' ',[],[]][]print(my_treeprint('left subtree 'my_tree[ ]print('root 'my_tree[ ]print('right subtree 'my_tree[ ] implementation