code: def insert_tree(self, items, node, headers):
          
          first = items[0]
          child = node.get_child(first)
          if child is not None:
              child.count += 1
          else:
              # Add new child.
              child = node.add_child(first)
  
              # Link it to header structure.
              if headers[first] is None:
                  headers[first] = child
              else:
                  current = headers[first]
                  while current.link is not None:
                      current = current.link
                  current.link = child
  
          # Call function recursively.
          remaining_items = items[1:]
          if len(remaining_items) > 0:
              self.insert_tree(remaining_items, child, headers)
docs: Recursively grow FP tree.