





'''simple docstring'''


from __future__ import annotations




def       A							(      _UpperCAmelCase   :				list[int]						,_UpperCAmelCase   :				int					)  ->				int:


  '''simple docstring'''




  __lowerCAmelCase     ,					__lowerCAmelCase		:    Dict			     =  0, len(_UpperCAmelCase					) - 1
  while start_ind <= end_ind:
    if array[start_ind] == search_item:
      return start_ind
    elif array[end_ind] == search_item:
      return end_ind
    else:
      start_ind += 1
      end_ind -= 1
    # returns -1 if search_item is not found in array
  return -1


if __name__ == "__main__":
    print(double_linear_search(list(range(1_00)), 40))












'''simple docstring'''


from __future__ import annotations

from collections.abc import Callable




def       A							(      _UpperCAmelCase   :				Callable[[int | float], int | float]						,_UpperCAmelCase   :				int | float						,_UpperCAmelCase   :				int | float						,_UpperCAmelCase   :				int = 1_0_0						,)  ->				float:


  '''simple docstring'''




  __lowerCAmelCase		:    Dict			     =  x_start
  __lowerCAmelCase		:    Tuple			     =  fnc(_UpperCAmelCase					)
  __lowerCAmelCase		:    Optional[int]			     =  0.0

  for _ in range(_UpperCAmelCase					):
    # Approximates small segments of curve as linear and solve
    # for trapezoidal area
    __lowerCAmelCase		:    Optional[int]			     =  (x_end - x_start) / steps + xa
    __lowerCAmelCase		:    Optional[Any]			     =  fnc(_UpperCAmelCase					)
    area += abs(fxa + fxa					) * (xa - xa) / 2

    # Increment step
    __lowerCAmelCase		:    Optional[Any]			     =  xa
    __lowerCAmelCase		:    List[Any]			     =  fxa
  return area


if __name__ == "__main__":




    def       A							(      _UpperCAmelCase   :				List[Any]					)  ->				List[Any]:


      '''simple docstring'''




      return x**3

    print("f(x) = x^3")
    print("The area between the curve, x = -10, x = 10 and the x axis is:")
    A_				     =							10
    while i <= 10_00_00:
        A_				     =							trapezoidal_area(f, -5, 5, i)
        print(F'''with {i} steps: {area}''')
        i *= 10





