



'''simple docstring'''





from __future__ import annotations






class 	lowerCAmelCase_:
		'''simple docstring'''




		def __init__(   self  ,__UpperCAmelCase				)   ->		None:
						lowerCAmelCase__			:  Union[str, Any]											= data
						lowerCAmelCase__			:  Node | None											= None
						lowerCAmelCase__			:  Node | None											= None







def        _SCREAMING_SNAKE_CASE  (	UpperCamelCase      ):  # In Order traversal of the tree



				"""simple docstring"""





				if tree:
								display(tree.left      )
								print(tree.data      )
								display(tree.right      )
def        _SCREAMING_SNAKE_CASE  (	UpperCamelCase      ):



				"""simple docstring"""





				return 1 + max(depth_of_tree(tree.left      )							,   depth_of_tree(tree.right      )      ) if tree else 0
def        _SCREAMING_SNAKE_CASE  (	UpperCamelCase      ):



				"""simple docstring"""





				if not tree:
								return True
				if tree.left and tree.right:
								return is_full_binary_tree(tree.left      ) and is_full_binary_tree(tree.right      )
				else:
								return not tree.left and not tree.right
def        _SCREAMING_SNAKE_CASE  (	):  # Main function for testing.



				"""simple docstring"""





				lowerCAmelCase__			:  List[Any]											= Node(1      )
				lowerCAmelCase__			:  Optional[int]											= Node(2      )
				lowerCAmelCase__			:  Union[str, Any]											= Node(3      )
				lowerCAmelCase__			:  Optional[int]											= Node(4      )
				lowerCAmelCase__			:  int											= Node(5      )
				lowerCAmelCase__			:  str											= Node(6      )
				lowerCAmelCase__			:  Any											= Node(7      )
				lowerCAmelCase__			:  str											= Node(8      )
				lowerCAmelCase__			:  Union[str, Any]											= Node(9      )

				print(is_full_binary_tree(UpperCamelCase__      )      )
				print(depth_of_tree(UpperCamelCase__      )      )
				print("""Tree is: """      )
				display(UpperCamelCase__      )


if __name__ == "__main__":
	main()







'''simple docstring'''





class 	lowerCAmelCase_:
  '''simple docstring'''




  def __init__(   self  ,__UpperCAmelCase				)   ->		Tuple:
      lowerCAmelCase__			:  Union[str, Any]											= n
      lowerCAmelCase__			:  int											= [None] * self.n
      lowerCAmelCase__			:  Union[str, Any]											= 0  # index of the first element
      lowerCAmelCase__			:  Union[str, Any]											= 0
      lowerCAmelCase__			:  Union[str, Any]											= 0




  def __len__(   self				)   ->		int:
      return self.size




  def 							UpperCAmelCase_     (   self				)   ->		bool:
      return self.size == 0




  def 							UpperCAmelCase_     (   self				)   ->		Optional[Any]:
      return False if self.is_empty() else self.array[self.front]




  def 							UpperCAmelCase_     (   self  ,__UpperCAmelCase				)   ->		Union[str, Any]:
      if self.size >= self.n:
          raise Exception("""QUEUE IS FULL"""				)

      lowerCAmelCase__			:  str											= data
      lowerCAmelCase__			:  List[str]											= (self.rear + 1) % self.n
      self.size += 1
      return self






  def 							UpperCAmelCase_     (   self				)   ->		int:
      if self.size == 0:
          raise Exception("""UNDERFLOW"""				)

      lowerCAmelCase__			:  int											= self.array[self.front]
      lowerCAmelCase__			:  Optional[Any]											= None
      lowerCAmelCase__			:  int											= (self.front + 1) % self.n
      self.size -= 1
      return temp


