The question is this
Your task is to implement a heap that can work with any backing storage. Basically you need to take the abstraction one step down – for instance we use the heap without worrying about the backing storage simply because the interface is well defined. So you need to design an interface for the backing storage so that methods implementing the heap interface will work for any backing storage. Your code should be developed in Java and it should work for any data type that extends the comparable class. In this part you only need to worry about two backing storages; array and linked structure. You need to provide the implementation for the two backing storages as well.
I'm struggling to understand what exactly should be done here. What i get is, the interface should work regardless of the backing storage type (arrays/linked lists) How can i implement the interface without a specific backing storage? The interface should supposedly include the add and remove function. Hope someone could shed some light on this problem. Thank you
EDIT this is my heap interface,
public interface HeapInterface<T extends Comparable<T>>{
public boolean isEmpty();
public void add(T value);
public T remove();
public void show();
}
and this is the declaration for the array implementation
public class arrayHeap<T extends Comparable<T>> implements HeapInterface {
wondering if there is anything wrong with the declarations because once I implement the add(T value) method inside the array implementation i get a bunch of errors