Jian Li
2004-03-04 03:59:46 UTC
From what I see, there are two possible relationships between LinkedList
class and PolynomialAsLinkedList class:
1. PolynomialAsLinkedList owns a member of the LinkedList class
2. PolynomialAsLinkedList extends from the LinkedList class
In class, the notes seem to lean towards 2, but 1 should be okay, too. I
defined a private inner class (so as to not violate the contract) called
Term inside PolynomialAsLinkedList, which is stored as the datum of the
LinkedList class.
Is this okay? Or is 2 mandatory. Thanks in advance.
Jian
class and PolynomialAsLinkedList class:
1. PolynomialAsLinkedList owns a member of the LinkedList class
2. PolynomialAsLinkedList extends from the LinkedList class
In class, the notes seem to lean towards 2, but 1 should be okay, too. I
defined a private inner class (so as to not violate the contract) called
Term inside PolynomialAsLinkedList, which is stored as the datum of the
LinkedList class.
Is this okay? Or is 2 mandatory. Thanks in advance.
Jian