


"""simple docstring"""






def      lowerCamelCase       (     _UpperCamelCase		:      list       ,			_UpperCamelCase		:      int = 0							)		->       list:

							'''simple docstring'''



							__UpperCAmelCase   :						Optional[int]      							=					length or len(_UpperCamelCase							)
							__UpperCAmelCase   :						Optional[Any]      							=					False
							for i in range(length - 1							):
														if list_data[i] > list_data[i + 1]:
																					__UpperCAmelCase							,__UpperCAmelCase   :						Union[str, Any]      							=					list_data[i + 1], list_data[i]
																					__UpperCAmelCase   :						str      							=					True

							return list_data if not swapped else bubble_sort(_UpperCamelCase       ,			length - 1							)


if __name__ == "__main__":
							import doctest

							doctest.testmod()




"""simple docstring"""






from collections.abc import Callable
def      lowerCamelCase       (     _UpperCamelCase		:      Callable[[float], float]       ,			_UpperCamelCase		:      float       ,			_UpperCamelCase		:      float							)		->       float:

							'''simple docstring'''



							__UpperCAmelCase   :						float      							=					a
							__UpperCAmelCase   :						float      							=					b
							if function(_UpperCamelCase							) == 0:  # one of the a or b is a root for the function
														return a
							elif function(_UpperCamelCase							) == 0:
														return b
							elif (
							    function(_UpperCamelCase							) * function(_UpperCamelCase							) > 0
							):  # if none of these are root and they are both positive or negative,
														# then this algorithm can't find the root
														raise ValueError("""could not find root in given interval."""							)
							else:
														__UpperCAmelCase   :						float      							=					start + (end - start) / 2.0
														while abs(start - mid							) > 1_0**-7:  # until precisely equals to 10^-7
																					if function(_UpperCamelCase							) == 0:
																												return mid
																					elif function(_UpperCamelCase							) * function(_UpperCamelCase							) < 0:
																												__UpperCAmelCase   :						Union[str, Any]      							=					mid
																					else:
																												__UpperCAmelCase   :						List[Any]      							=					mid
																					__UpperCAmelCase   :						Optional[Any]      							=					start + (end - start) / 2.0
														return mid
def      lowerCamelCase       (     _UpperCamelCase		:      float							)		->       float:

							'''simple docstring'''



							return x**3 - 2 * x - 5


if __name__ == "__main__":
							print(bisection(f, 1, 1000))

							import doctest

							doctest.testmod()
