

"""simple docstring"""



def  _snake_case     (    UpperCAmelCase_  :					list			):
     A__										=  len(UpperCAmelCase_			)
     for _ in range(UpperCAmelCase_			):
          for i in range(_ % 2					,   arr_size - 1					,   2			):
               if arr[i + 1] < arr[i]:
                    A__			,				A__										=  arr[i + 1], arr[i]

     return arr


if __name__ == "__main__":
 SCREAMING_SNAKE_CASE_					:	Optional[int]							  =						list(range(1_0, 0, -1))
 print(f"""Original: {arr}. Sorted: {odd_even_transposition(arr)}""")









"""simple docstring"""



from collections.abc import Callable





def  _snake_case     (    UpperCAmelCase_  :					Callable[[float], float]					,   UpperCAmelCase_  :					float					,   UpperCAmelCase_  :					float			):
     A__										=  a
     A__										=  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:
          A__										=  start + (end - start) / 2.0
          while abs(start - mid			) > 10**-7:  # until precisely equals to 10^-7
               if function(UpperCAmelCase_			) == 0:
                    return mid
               elif function(UpperCAmelCase_			) * function(UpperCAmelCase_			) < 0:
                    A__										=  mid
               else:
                    A__										=  mid
               A__										=  start + (end - start) / 2.0
          return mid





def  _snake_case     (    UpperCAmelCase_  :					float			):
     return x**3 - 2 * x - 5


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

 import doctest

 doctest.testmod()






