Created 01/07/03; revised 11/03/2012, 06/20/2016

# on Recursion

Instructions: For each question, choose the single best answer. Make your choice by clicking on its button. You can change your answers at any time. When the quiz is graded, the correct answers will appear in the box after each question.

1. What are two parts to recursion?

A.    (1) If the problem is easy, solve it immediately, and (2) If the problem can't be solved immediately, divide it into smaller problems and solve each one.

B.    (1) Divide the problem into smaller problems, and (2) give immediate solutions for the hard problems.

C.    (1) Discard the hard cases , and (2) solve the easy cases.

D.    (1) Solve the problem by asking it to solve itself, (2) Solve the easy cases in one step.

2. How can you drink a pitcher of beer?

A.    (1) take one sip of beer, then (2) take another sip.

B.    (1) If there is just a little beer left, drink it; otherwise (2) take one sip of beer, then drink the rest of the pitcher.

C.    (1) Finish the pitcher in one enormous gulp, and (2) wish you hadn't.

D.    (1) drink one pitcher, and (2) drink another pitcher.

3. How do you study a text book?

A.    (1) Read the entire book in one day, and (2) read it again every day of the semester.

B.    (1) If there is one page left, read it, and you are done; otherwise: (2) study one page, then study the rest of the book.

C.    (1) Rip the book in two, and (2) study each half.

D.    (1) Read all the pages in one horrible cram session the night before the final, and (2) forget everything the next day.

4. How does Sherlock Holmes solve a murder mystery?

A.    (1) The butler did it.

B.    (1) Question one witness, and (2) question the victim.

C.    (1) Eliminate one witness, and (2) eliminate the remaining witnesses.

D.    (1) When one suspect remains, that is who did it. (2) Examine the evidence to eliminate one suspect, continue investigating the remaining suspects.

5. How does a Web crawler visit every Web page at a Web site?

D.    (1) If a page has no links, look no further. (2) If the page has links to other pages, visit each link.

6. How do you shovel your sidewalk after a snowstorm?

A.    (1) If a small clump of snow is left, shovel it away. (2) Remove one shovel of snow, then shovel the rest of the walk.

B.    (1) If a small clump of snow is left, shovel it away. (2) Remove all the snow except for a small clump.

C.    (1) Remove one snowflake. (2) Remove the rest of the snowflakes.

D.    (1) Remove all matching snowflakes. (2) Remove remaining snowflakes