Topics: Simple Algorithms: bisection search, Newton-Raphson
Lecture Notes
Readings
Ch 3.4, 3.5
Finger Exercise Lecture 6
Assume you are given an integer \(0 <= N <=1000\). Write a piece of Python code that uses bisection search to guess N. The code prints two lines: count:
with how many guesses it took to find N, and answer:
with the value of N. Hints: If the halfway value is exactly in between two integers, choose the smaller one.