Assignment 11, due Apr 22
Part of
the homework for CS:2820, Spring 2016
|
On every assignment, write your name legibly as it appears on your University ID card! Homework is due on paper at the start of lecture on the day indicated. Exceptions will be made only by advance arrangement (excepting "acts of God"). Late work must be turned in to the TA's mailbox (ask the CS receptionist in 14 MLH for help). Never push homework under someone's door!
Assume for the purpose of this problem that class LinkedList has only the following methods: get(int index), set(int index,E element), push(E element), size(E element), clear(), plus one initializer, LinkedList(). files as a starting point for your solution to MP5.
A problem: Give a complete and syntactically correct Java code for class FinalizableList. No comments, but make it readable. (1.0 points)
A problem: Give Java code that you could add to your class defined above to define a pair of new methods, setI(int index), and setE(E element), such that a call to o.set(i,e) can be replaced with o.setI(i);o.setE(e). If you have to declare new fields of class FinalizableList to do this, feel free to declare them as needed. (1.0 point)
A problem: Rewrite the lightChanges method from Exam 2 problem 3 to use this new framework. (1.0 points)