

Study with the several resources on Docsity
Earn points by helping other students or get them with a premium plan
This page cannot be seen from the preview
Don't miss anything!


CS5050 Homework 2, Chapter 6 Due on date specified by Eagle (due at class time) 10 points
Written homework provides an excellent framework for achieving the goals of obtaining a working knowledge of data structures, perfecting programming skills, and developing critical thinking strategies to aid the design and evaluation of algorithms. Since programming has a high overhead in terms of program entry and debugging, all important topics in this course cannot be covered via programming projects. Written homework exercises allow students to learn important material without a high time investment. Although the point value is low, the benefits are great. You can perfect your design skills without spending hours at the computer and can get feedback on your thinking skills from your study partners. Students who consistently do quality homework have far superior test scores.
Because assignments are done as a group and any questions are discussed in class or during office hours, written solutions to the homework will not be provided.
Note, these exercises may be done in groups of one, two, or three. If more than one person is involved, list all the names on ONE set of answers. Groups may change throughout the quarter. Answers should not be compared with others not in your group.
These are typed exercises, but you are certainly encouraged to actually code the programming segments if you have time.
boolean doit (int beg, int end) // Notice this is NOT a suggestion for this particular problem
Your matrix would have rows used as beg, columns used as end, and what was stored in the matrix would be booleans. The only thing left to do would be to decide the order in which the rows/columns/diagonals would be filled.
HINT: This problem is quite similar to the "making change" problem. You have to find a way that the problem gets smaller – either in the amount you are dealing with or the number of items you are allowed to use in the solution. Think "use it" or "don't use it".
The example below shows two possible triangulations of the polygon. Assuming the labels represent weight, the right triangulation is better.