Given the nature of a set, one could implement the Set interface using any one of a variety of other collections or data structures. Describe how you might implement the Set interface using a LinkedList. Discuss the advantages and disadvantages of this approach.
What will be an ideal response?
A LinkedList would be a fairly straightforward implementation, although not particularly efficient, strategy for a set. The add method would check for duplicates and only add unique items. Otherwise, most operations could come directly from the list implementation. However, the operations are not nearly as efficient as the tree-based solutions in the API.
You might also like to view...
A wiki is a server program that allows users to collaborate to create Web site content
Indicate whether the statement is true or false
____________________ is a phenomenon in which a signal is sampled at a rate less than the sampling frequency rate.
Fill in the blank(s) with the appropriate word(s).
What is DirectX?
What will be an ideal response?
Which of the following allows a user to make a copy of all or part of a work, even if permission has not been granted?
A. Derivative work B. Fair use doctrine C. Intellectual property D. Copyright