How many steps does the following Bisection Search take to a…
How many steps does the following Bisection Search take to approximate the square root of 25 with an error margin of 0.01? num = 8epsilon = 0.1num_guesses = 0low = 0high = numguess = (high + low) / 2.0while abs(guess**2 – num) >= epsilon: if guess**2 < num: low = guess else: high = guess guess = (high + low) / 2.0 num_guesses += 1
Read DetailsHow many steps does the following Exhaustive Enumeration tak…
How many steps does the following Exhaustive Enumeration take to approximate the square root of 9 with an increment of 0.2? num = 9epsilon = 0.1guess = 0.0increment = 0.2num_guesses = 0while abs(guess**2 – num) >= epsilon and guess
Read Details