Algorithms & Programming unit test
A test on this unit alone, marked as a percentage and a letter grade — for the test your class is actually sitting, rather than for May. Answer everything, then submit once: seeing the answer to question 3 before attempting question 4 makes the final percentage meaningless.
Decidable vs undecidable
Variable
List indexing in AP pseudocode
Binary search
INSERT
REPEAT UNTIL
FOR EACH loop
Sequential computing
Undecidable problem
Nested conditional
NOT
Simulation
Short answer 1. Define or explain: Heuristic
3 ptsShort answer 2. Define or explain: Speedup
3 ptsShort answer 3. Define or explain: Algorithm
3 ptsShort answer 4. Define or explain: Why binary search needs a sorted list
3 ptsFree response
6 ptsA programmer needs to determine whether a list of student records contains any duplicate identification numbers. Approach A compares every record to every other record. Approach B first sorts the list by identification number and then checks only adjacent pairs.
For a list of 1,000 records, estimate the number of comparisons each approach performs, and show your reasoning.
Explain why Approach B can be faster overall even though it performs an additional sorting step.
Describe a situation in which Approach A would be the better choice.
Explain what is meant by an undecidable problem, and state whether determining the presence of duplicates is one.