Reference no: EM132390806
Assignment
Let your ID be the number, d0 d1 d2 ... d6, where each di is a single digit, d0 being the most significant digit. Define ij = max(5, dj).
1. In the activity selection problem, if we change the objective to maximizing the time the resource is used (instead of a largest set of compatible activities) with compatible activities, of course. Does this problem have optimal substructure? State the property carefully and then prove or disprove.
2. Suppose that instead of doubling the table on an overflow, we multiply the size by i6, where i6 is defined above. Reanalyze using the potential method the exact amortized cost of the insert operation. Assume only insert operations for this question.
3. Suppose that instead of doubling the table on an overflow and halving on an underflow, we multiply the size by i5 on an overflow and divide the size by i4 on an underflow, where i5 and i4 are as above. Reanalyze using the potential method the exact amortized cost of the insert and
delete operations.
4. What are the main differences between the class of compression algorithms used in JPEG/MPEG and compression using Huffman codes?
5. What are the main differences between average case analysis and amortized analysis?
6. Give the definition of an equivalence relation on a set S. Give two very different examples of equivalence relations on the set of Natural numbers.