0% found this document useful (0 votes)
3 views2 pages

Iteration and Search Problem Solving

This lecture discusses using iteration and loops to build programs that can solve search problems like brute force and bisection searches. It covers topics like termination, decrementing functions, exhaustive enumeration, while loops, for loops, approximation, specifications, and bisection search. The lecture includes videos, code examples, and self-check questions about program termination and for loops.

Uploaded by

CoursePin
Copyright
© Attribution Non-Commercial (BY-NC)
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
3 views2 pages

Iteration and Search Problem Solving

This lecture discusses using iteration and loops to build programs that can solve search problems like brute force and bisection searches. It covers topics like termination, decrementing functions, exhaustive enumeration, while loops, for loops, approximation, specifications, and bisection search. The lecture includes videos, code examples, and self-check questions about program termination and for loops.

Uploaded by

CoursePin
Copyright
© Attribution Non-Commercial (BY-NC)
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd

Problem Solving

Session Overview
This lecture covers the use of iteration to build programs whose execution time depends upon the size of inputs. It also introduces search problems and brute force and bisection for solving them.

Session Activities
Lecture Videos

Lecture 3: Problem Solving (00:47:56)

About this Video Topics covered: Termination, decrementing functions, exhaustive enumeration, brute force, while loop, for loop, approximation, specifications, bisection search. Resources

Lecture code handout (PDF) Lecture code (PY)

Check Yourself
What does it mean for a program to terminate? answer Either the program will return a value, or throw an exception. A program that does not terminate runs indefinitely, typically because it's gotten stuck in a loop. What is a for loop?

answer A for loop takes some sort of iterable object (a list, tuple, or string) and performs its function once for each item in that object. Any function that depends on the input can have a different result at each step, since the input is the current item.

Further Study
These optional resources are provided for students that wish to explore this topic more fully. Readings

Loops. An Introduction to Python.

You might also like