Data Structure, HW03

Posted on: Fri, 11/19/2010 - 10:24 By: dae

You must create a class ArrayCollectionByList from this stub.

You are not allow to declare any additional member, i.e., you cannot declare [code]public int size[/code] nor [code lang="java"]public Object [] elementData[/code], you have to do everything via col only

[code lang="java"] public class ArrayCollectionByList implements Collection { private ArrayCollection col;

public ArrayCollectionByList (int c) { //fill your code here } public int size() { //fill your code here } public boolean isEmpty() { //fill your code here } public boolean contains(Object e) { //fill your code here } public void remove(Object e) { //fill your code here } public void add(Object e) { //fill your code here } public Object[] toArray() { //fill your code here } } [/code]