parameters: (root, word, cur_path)
docstring: Recursively traverse a binary search tree containing
      words sorted alphabetically, searching for a particular
      word in the tree.  Also maintains a string representing
      the path from the root of the tree to the current node.
      If the word is found in the tree, return the path string.
      Otherwise return an empty string.
  
      This function assumes the binary search tree is
      the one defined in dictionary.c  It uses LLDB API
      functions to examine and traverse the tree nodes.
docstring_summary: Recursively traverse a binary search tree containing
      words sorted alphabetically, searching for a particular
      word in the tree.  Also maintains a string representing
      the path from the root of the tree to the current node.
      If the word is found in the tree, return the path string.
      Otherwise return an empty string.
docstring_tokens: Recursively traverse a binary search tree containing words sorted alphabetically searching for a particular word in the tree . Also maintains a string representing the path from the root of the tree to the current node . If the word is found in the tree return the path string . Otherwise return an empty string .
function: def DFS(root, word, cur_path):
      """
      Recursively traverse a binary search tree containing
      words sorted alphabetically, searching for a particular
      word in the tree.  Also maintains a string representing
      the path from the root of the tree to the current node.
      If the word is found in the tree, return the path string.
      Otherwise return an empty string.
  
      This function assumes the binary search tree is
      the one defined in dictionary.c  It uses LLDB API
      functions to examine and traverse the tree nodes.
      """
  
      # Get pointer field values out of node 'root'
  
      root_word_ptr = root.GetChildMemberWithName("word")
      left_child_ptr = root.GetChildMemberWithName("left")
      right_child_ptr = root.GetChildMemberWithName("right")
  
      # Get the word out of the word pointer and strip off
      # surrounding quotes (added by call to GetSummary).
  
      root_word = root_word_ptr.GetSummary()
      end = len(root_word) - 1
      if root_word[0] == '"' and root_word[end] == '"':
          root_word = root_word[1:end]
      end = len(root_word) - 1
      if root_word[0] == '\'' and root_word[end] == '\'':
          root_word = root_word[1:end]
  
      # Main depth first search
  
      if root_word == word:
          return cur_path
      elif word < root_word:
  
          # Check to see if left child is NULL
  
          if left_child_ptr.GetValue() is None:
              return ""
          else:
              cur_path = cur_path + "L"
              return DFS(left_child_ptr, word, cur_path)
      else:
  
          # Check to see if right child is NULL
  
          if right_child_ptr.GetValue() is None:
              return ""
          else:
              cur_path = cur_path + "R"
              return DFS(right_child_ptr, word, cur_path)
function_tokens: def DFS ( root , word , cur_path ) : # Get pointer field values out of node 'root' root_word_ptr = root . GetChildMemberWithName ( "word" ) left_child_ptr = root . GetChildMemberWithName ( "left" ) right_child_ptr = root . GetChildMemberWithName ( "right" ) # Get the word out of the word pointer and strip off # surrounding quotes (added by call to GetSummary). root_word = root_word_ptr . GetSummary ( ) end = len ( root_word ) - 1 if root_word [ 0 ] == '"' and root_word [ end ] == '"' : root_word = root_word [ 1 : end ] end = len ( root_word ) - 1 if root_word [ 0 ] == '\'' and root_word [ end ] == '\'' : root_word = root_word [ 1 : end ] # Main depth first search if root_word == word : return cur_path elif word < root_word : # Check to see if left child is NULL if left_child_ptr . GetValue ( ) is None : return "" else : cur_path = cur_path + "L" return DFS ( left_child_ptr , word , cur_path ) else : # Check to see if right child is NULL if right_child_ptr . GetValue ( ) is None : return "" else : cur_path = cur_path + "R" return DFS ( right_child_ptr , word , cur_path )