input: Write a function to calculate approximate root using bisection algorithm.
  assert abs(bisection(15, 0.001)**2 - 15) < 0.001
  assert abs(bisection(25, 0.0001)**2 - 25) < 0.0001
  assert abs(bisection(2, 0.01)**2 - 2) < 0.01
output: def bisection(n, tolerance):
      low = 0
      high = max(1, n)
      mid = (low + high) / 2
      
      while abs(mid**2 - n) > tolerance:
          if mid**2 < n:
              low = mid
          else:
              high = mid
          mid = (low + high) / 2
      
      return mid