'''simple docstring'''




class        a__ :






     def __init__(					self						:						Any    ,							a						:						Dict       ):





         """simple docstring"""



         __lowerCamelCase            =    val
         __lowerCamelCase            =    None
         __lowerCamelCase            =    None






     def   SCREAMING_SNAKE_CASE__  (					self						:						str    ,							a						:						Tuple       ):





         """simple docstring"""



         if self.val:
             if val < self.val:
                 if self.left is None:
                     __lowerCamelCase            =    Node(a       )
                 else:
                     self.left.insert(a       )
             elif val > self.val:
                 if self.right is None:
                     __lowerCamelCase            =    Node(a       )
                 else:
                     self.right.insert(a       )
         else:
             __lowerCamelCase            =    val






def __lowerCAmelCase					(				UpperCamelCase__							,    UpperCamelCase__							)      ->       int:
    # Recursive traversal
    if root:
        inorder(root.left							,    UpperCamelCase__							)
        res.append(root.val							)
        inorder(root.right							,    UpperCamelCase__							)






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


if __name__ == "__main__":
  print(tree_sort([1_0, 1, 3, 2, 9, 1_4, 1_3]))

'''simple docstring'''




def __lowerCAmelCase					(				UpperCamelCase__							)      ->       bool:
    if not isinstance(UpperCamelCase__							,    UpperCamelCase__							):
        raise ValueError('''Input series is not valid, valid series - [2, 4, 6]'''							)
    if len(UpperCamelCase__							) == 0:
        raise ValueError('''Input list must be a non empty list'''							)
    if len(UpperCamelCase__							) == 1:
        return True
    __lowerCamelCase            =    series[1] - series[0]
    for index in range(len(UpperCamelCase__							) - 1							):
        if series[index + 1] - series[index] != common_diff:
            return False
    return True






def __lowerCAmelCase					(				UpperCamelCase__							)      ->       float:
    if not isinstance(UpperCamelCase__							,    UpperCamelCase__							):
        raise ValueError('''Input series is not valid, valid series - [2, 4, 6]'''							)
    if len(UpperCamelCase__							) == 0:
        raise ValueError('''Input list must be a non empty list'''							)
    __lowerCamelCase            =    0
    for val in series:
        answer += val
    return answer / len(UpperCamelCase__							)


if __name__ == "__main__":
  import doctest

  doctest.testmod()
