{[ promptMessage ]}

Bookmark it

{[ promptMessage ]}


36-CS106X-Practice-Final - CS106X Autumn 2010 Handout 36...

Info iconThis preview shows pages 1–3. Sign up to view the full content.

View Full Document Right Arrow Icon
CS106X Handout 36 Autumn 2010 December 6 th , 2010 CS106X Practice Final Exam Exam Facts Offering 1 When: December 10 th , 2009 at 8:30 a.m. Where: Gates B01 and B03 Offering 2 When: December 10 th , 2009 at 3:30 p.m. Where: TBD SCPD students can either come to campus on Friday morning, or they can take the exam remotely anytime on Friday, provided you email me ahead of time so I can email you the exam. My cell and fax numbers will be printed on the front page of the exam. You can call me during if you have questions, and you can use the fax number to get us a copy of your exam. Hold on to your original until you get the faxed copy back. You don’t need to take the exam at the office, and you don’t need a proctor. Just self-administer so you have maximum flexibility on when you take it. Coverage The final is comprehensive and covers material from the entire quarter, but will tend to focus on the topics covered after the midterm, which means be prepared for recursive backtracking, memoization, nitty-gritty implementation-side work (pointers, linked lists, trees, graphs, hash tables, function pointers, and so on), and inheritance. It will be a 3-hour exam. It will be open book/open note, but no electronics. This handout is intended to give you practice solving problems that are comparable to those which will appear on the exam. We highly recommend working through the problems in test-like conditions to prepare for the actual exam. Many of our section problems have been taken from previous exams and chapter exercises from the reader often make appearances in same or similar forms on exams, so both of those resources are a valuable source of study material as well. Be sure to bring the reader with you to the exam. We won't repeat the standard class definitions on the exam, so the reader appendix will come in handy for looking up the library interfaces.
Background image of page 1

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full Document Right Arrow Icon
Problem 1: Recursive Backtracking and the 70 2 Puzzle It’s a little known fact that the sum of the first 24 positive squares—that is, 1 + 4 + 9 + … + 23 2 + 24 2 —is equal to 4900, which just happens to be the square of 70. For math nerds around the globe, this leads to the question of whether or not 24 square tiles of area 1, 4, 9, 16, and so forth can be laid down to completely cover a 70 x 70 board. Here’s a partial tiling of a 70 x 70 board where tiles with sides of unit lengths 15 – 24 have been placed, but tiles with sides of length 1 – 14 have not. Your job is to use recursive backtracking to determine whether or not such a tiling exists. You should assume that the following functions exist and operate as described: // returns true if and only if a square of the specified dimension could be // placed without overlapping the edges or any previously placed squares such // that the lower left corner of the tile covers the cell at (row, col) CanPlaceSqaure(Grid<bool>& board, int dimension, int row, int col); // Updates the board to reflect that a square tile of the specified dimension // has been placed such that its lower left corner covers the cell at (row, col)
Background image of page 2
Image of page 3
This is the end of the preview. Sign up to access the rest of the document.

{[ snackBarMessage ]}

Page1 / 8

36-CS106X-Practice-Final - CS106X Autumn 2010 Handout 36...

This preview shows document pages 1 - 3. Sign up to view the full document.

View Full Document Right Arrow Icon bookmark
Ask a homework question - tutors are online