original_docstring: Returns the index of the given element within the array by performing a binary search.
docstring: Returns the index of the given element within the array by performing a binary search.
docstring_tokens: Returns the index of the given element within the array by performing a binary search .
code: def binary_search(arr, element, low=0, high=None):
      """Returns the index of the given element within the array by performing a binary search."""
      if high == None:
          high = len(arr) - 1
  
      if high < low:
          return -1
  
      mid = (high + low) // 2
  
      if arr[mid] == element: 
          return (mid, arr[mid])
  
      elif arr[mid] > element:
          return binary_search(arr, element, low, mid-1)
  
      else: 
          return binary_search(arr, element, mid+1, high)
code_tokens: def binary_search ( arr , element , low = 0 , high = None ) : if high == None : high = len ( arr ) - 1 if high < low : return - 1 mid = ( high + low ) // 2 if arr [ mid ] == element : return ( mid , arr [ mid ] ) elif arr [ mid ] > element : return binary_search ( arr , element , low , mid - 1 ) else : return binary_search ( arr , element , mid + 1 , high )
short_docstring: Returns the index of the given element within the array by performing a binary search.
short_docstring_tokens: Returns the index of the given element within the array by performing a binary search .
comment: """Returns the index of the given element within the array by performing a binary search."""