Assignments

Homework 1, due Friday, August 30 (Solutions)
Chapter 1, Exercises 1, 3 (page 11), 4, 5, 7, 8, 16, and 17 (pages 19-21)
Chapter 2, Exercises 2 (page 33), 28-31 (page 48), and 51 (page 64)
Programming Project 1, due Friday, September 13, at 5 p.m. (Model Solution)
Implement the in-shuffle and out-shuffle operations on linked lists, and demonstrate that the magic trick discussed in class works by creating an ordered list of cards, performing an in, out, out sequence of shuffles, and then displaying the fifth card in the deck (which should be the original first card). For extra credit, allow the user to specify which position the first card should be moved to, and do the correct sequence of shuffles.
Homework 2, due Monday, September 23 (Solutions)
Chapter 6, Exercises 5, 6 (page 272), 11, 14 (page 274), 15, 18 (page 277), 22 (page 279), 26, 27 (page 284), 33, and 35 (pages 291-2)
Chapter 7, Exercises 1 (page 321), 8, and 9 (pages 324-5)
Homework 3, due Friday, October 18 (Solutions)
Chapter 8, Exercises 1, 2, 5, 6, 9, 24
Chapter 9, Exercises 1, 2, 3, 4, 5, 21
Programming Project 2, due Monday, November 4, at 5 p.m. (Model Solution)
Write a program which will efficiently perform the following operations (allow the user to choose these from a menu): The files of place information, which are based on data from the U.S. Census Bureau, have the following format on each line:
place name (40 characters wide; may contain spaces)
state abbreviation (2 characters)
population (10 characters, right justified)
degrees latitude (11 characters, prefixed + for North)
degrees longitude (12 characters, prefixed - for West or + for East)
For example, placesw.txt starts as follows:
Adak Station                            AK      4633 +51.842900 -176.640278
Akhiok                                  AK        77 +56.977320 -154.217551
Akiachak                                AK       481 +60.871740 -161.403575
Akiak                                   AK       285 +60.885659 -161.192264
Akutan                                  AK       589 +54.136299 -165.786036
Alakanuk                                AK       544 +62.675611 -164.643602
Alcan                                   AK        27 +62.722977 -141.188178
Aleknagik                               AK       185 +59.285485 -158.628962
Allakaket                               AK       170 +66.545170 -152.733117
Ambler                                  AK       311 +67.076879 -157.918155
Amchitka                                AK        25 +51.567103 +178.877380
If the user chooses to read both files of place information, then the queries should search the combined list of places. We will discuss appropriate data structures and algorithms in class after the fall break; be prepared to make suggestions.
Review Problems for Friday, November 15 (Solutions)
Chapter 12, Exercises 26, 27, 47, 51, 73, 79, and 80
Chapter 13, Exercises 39 and 48
Review Problems for Friday, December 6 (Solutions)
Chapter 17, Exercises 17 and 27
Chapter 18, Exercises 6, 7, 15, 16, 50, and 51