code: def get_dict(self, u=None):
          
          if u is None:
              return self.get_dict(self.root)
          children = []
          for v in self.adj_list[u]:
              children.append(self.get_dict(v))
          ret = {"name": u, "children": children}
          return ret
docs: A recursive function to return the content of the tree in a dict.