6.100L | Fall 2022 | Undergraduate

Introduction to CS and Programming using Python

Lecture 6: Bisection Search

Topics: Simple Algorithms: bisection search, Newton-Raphson

Lecture Notes

Lecture 6: Bisection Search

Lecture 6 Code

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.

6.100L Finger Exercises Lecture 6 Solutions

Course Info

Instructor
As Taught In
Fall 2022
Learning Resource Types
Lecture Videos
Lecture Notes
Problem Sets
Programming Assignments with Examples
Readings
Problem-solving Notes
Podcasts