parameters: (self, root)
docstring: :type root: TreeNode
docstring_summary: :type root: TreeNode
docstring_tokens: : type root : TreeNode
function: def __init__(self, root):
          """
          :type root: TreeNode
          """
          def dfs(node, v, lookup):
              if not node:
                  return
              node.val = v    
              lookup.add(v)
              dfs(node.left, 2*v+1, lookup)
              dfs(node.right, 2*v+2, lookup)
  
          self.__lookup = set()
          dfs(root, 0, self.__lookup)
function_tokens: def __init__ ( self , root ) : def dfs ( node , v , lookup ) : if not node : return node . val = v lookup . add ( v ) dfs ( node . left , 2 * v + 1 , lookup ) dfs ( node . right , 2 * v + 2 , lookup ) self . __lookup = set ( ) dfs ( root , 0 , self . __lookup )