






class       __a  :







 def __init__(		self :       str							,       SCREAMING_SNAKE_CASE :       Any						):


      '''simple docstring'''






      UpperCamelCase__      :       Optional[int]	    =  val
      UpperCamelCase__      :       Optional[int]	    =  None
      UpperCamelCase__      :       int	    =  None







 def  __lowercase (		self :       int							,       SCREAMING_SNAKE_CASE :       str						):


      '''simple docstring'''






      if self.val:
           if val < self.val:
                if self.left is None:
                     UpperCamelCase__      :       Any	    =  Node(SCREAMING_SNAKE_CASE						)
                else:
                     self.left.insert(SCREAMING_SNAKE_CASE						)
           elif val > self.val:
                if self.right is None:
                     UpperCamelCase__      :       Optional[int]	    =  Node(SCREAMING_SNAKE_CASE						)
                else:
                     self.right.insert(SCREAMING_SNAKE_CASE						)
      else:
           UpperCamelCase__      :       Tuple	    =  val







def 		SCREAMING_SNAKE_CASE							( __lowerCAmelCase ,   __lowerCAmelCase      )			->     Optional[Any]:
     # Recursive traversal
     if root:
          inorder(root.left ,   __lowerCAmelCase      )
          res.append(root.val      )
          inorder(root.right ,   __lowerCAmelCase      )







def 		SCREAMING_SNAKE_CASE							( __lowerCAmelCase      )			->     List[str]:
     # Build BST
     if len(__lowerCAmelCase      ) == 0:
          return arr
     UpperCamelCase__      :       List[str]	    =  Node(arr[0]      )
     for i in range(1 ,   len(__lowerCAmelCase      )      ):
          root.insert(arr[i]      )
     # Traverse BST in order.
     UpperCamelCase__      :       Tuple	    =  []
     inorder(__lowerCAmelCase ,   __lowerCAmelCase      )
     return res


if __name__ == "__main__":
 print(tree_sort([10, 1, 3, 2, 9, 14, 13]))







from __future__ import annotations







def 		SCREAMING_SNAKE_CASE							( __lowerCAmelCase ,   __lowerCAmelCase      )			->     list[int]:
     UpperCamelCase__      :       Optional[Any]	    =  0
     UpperCamelCase__      :       Any	    =  len(__lowerCAmelCase      ) - 1

     while i < j:
          if nums[i] + nums[j] == target:
               return [i, j]
          elif nums[i] + nums[j] < target:
               UpperCamelCase__      :       Optional[int]	    =  i + 1
          else:
               UpperCamelCase__      :       Dict	    =  j - 1

     return []


if __name__ == "__main__":
 import doctest

 doctest.testmod()
 print(F"""{two_pointer([2, 7, 11, 15], 9) = }""")