In addition to the concepts below, you should also know the
concepts from Quiz 1,
Quiz 2, and Quiz 3.
Many of the earlier concepts -- especially functions -- are fundamental
to what we've been studying recently.
You should be able to define the following terms:
- definite loop
- indefinite loop
- top-down design
- unit testing
- bottom-up development
- stubbed-out function
- pseudocode
- file object
- newline character
- running time of an algorithm
- Big-O notation
- search
- linear search, including its input requirements, the details of the
algorithm, and its worst-case running time
- binary search, including its input requirements, the details of the
algorithm, and its worst-case running time
You should understand and be able to use the following Python concepts:
- while (indefinite) loops
- the file methods open() and close()
- definite loops on a file
- the string strip() method
- the list append() method
- You should also be able to write basic operations using lists and files,
such as:
- read and print all lines in a file
- read all lines in a file and store as a list
Practice problems:
- Write a while loop that prints out all even numbers from 2 to 20.
- Write a program that reads in the following data from a file
and computes the average value:
98
100
91
82
88
86
77
- Given any specific definite (for) loop, write an indefinite (while) loop
that performs the same computation.
- Discussion question 3 on page 261
- True/False 1-4 from Chapter 13 (pgs. 460-461)
- Multiple choice problems 1,2 on page 460 (Chapter 13)
- Discussion question 1 on page 462 (Chapter 13)
- What is the minimum and maximum possible number of items linear
search will inspect to find a value in a list of n=64 items?
What are the min and max possible number of items to inspect
for a binary search with n=64?
- Show the low, high, and mid values for each step of a binary
search for the value 7 in this list: [ -3, 4, 5, 10, 14, 18, 22, 31, 44, 66, 70]
include("../style/footer.php"); ?>