



"""simple docstring"""


from __future__ import annotations

from collections.abc import Iterable, Iterator
from typing import Any, Generic, TypeVar

snake_case_         = TypeVar("""T""", bound=bool)







class    A_    (  Generic[T]       ):



						"""simple docstring"""






						def __init__(      self				:Optional[int]     ,						lowercase_				:T      )       ->    None:
												UpperCAmelCase    =				value
												UpperCAmelCase    =				None
												UpperCAmelCase    =				None






						@property
						def 			UpperCAmelCase__  (      self				:Tuple      )       ->    T:
												return self._value






						@staticmethod
						def 			UpperCAmelCase__  (      lowercase_				:SkewNode[T] | None     ,						lowercase_				:SkewNode[T] | None      )       ->    SkewNode[T] | None:







												if not roota:
																		return roota

												if not roota:
																		return roota

												if roota.value > roota.value:
																		UpperCAmelCase    =				roota, roota

												UpperCAmelCase    =				roota
												UpperCAmelCase    =				roota.right
												UpperCAmelCase    =				roota.left
												UpperCAmelCase    =				SkewNode.merge(UpperCamelCase__     ,						UpperCamelCase__      )

												return result







class    A_    (  Generic[T]       ):



						"""simple docstring"""






						def __init__(      self				:Union[str, Any]     ,						lowercase_				:Iterable[T] | None = ()      )       ->    None:
												UpperCAmelCase    =				None
												if data:
																		for item in data:
																								self.insert(UpperCamelCase__      )






						def __bool__(      self				:Dict      )       ->    bool:
												return self._root is not None






						def __iter__(      self				:Dict      )       ->    Iterator[T]:
												UpperCAmelCase    =				[]
												while self:
																		result.append(self.pop()      )

												# Pushing items back to the heap not to clear it.
												for item in result:
																		self.insert(UpperCamelCase__      )

												return iter(UpperCamelCase__      )






						def 			UpperCAmelCase__  (      self				:Dict     ,						lowercase_				:T      )       ->    None:
												UpperCAmelCase    =				SkewNode.merge(self._root     ,						SkewNode(UpperCamelCase__      )      )






						def 			UpperCAmelCase__  (      self				:str      )       ->    T | None:
												UpperCAmelCase    =				self.top()
												UpperCAmelCase    =				(
												    SkewNode.merge(self._root.left     ,						self._root.right      ) if self._root else None
												)

												return result






						def 			UpperCAmelCase__  (      self				:List[Any]      )       ->    T:







												if not self._root:
																		raise IndexError('Can\'t get top element for the empty heap.'      )
												return self._root.value






						def 			UpperCAmelCase__  (      self				:Dict      )       ->    None:
												UpperCAmelCase    =				None


if __name__ == "__main__":
				import doctest

				doctest.testmod()










"""simple docstring"""


from math import exp

def 				_lowerCAmelCase   (     lowercase_		):
						return 8 * x - 2 * exp(-x		)

def 				_lowerCAmelCase   (     lowercase_	,			lowercase_	,			lowercase_		):
						UpperCAmelCase    =				lower_bound
						UpperCAmelCase    =				upper_bound
						for _ in range(0	,			lowercase_		):
												UpperCAmelCase   ,					UpperCAmelCase    =				xa, xa - (f(lowercase_		) * (xa - xa)) / (f(lowercase_		) - f(lowercase_		))
						return xa


if __name__ == "__main__":
				print(f'''Example: {secant_method(1, 3, 2)}''')





