I have declared a class ArrayDeque
which takes in an Circular Array A1
and I want to try and add an element to the back of the Array.
I have only declared variable such as head
and tail
and size and intialized them. However, I'm completely stuck on what am I supposed to do next.
Here is my code so far:
public class ArrayDeque<T> {
private int volume = 0;
private int size = 0;
private int head = 0;
private int tail = 0;
private Object[] A1;
public ArrayDeque(int volume) {
this.volume = volume;
A1 = new Object[volume];
}
public void addLast(T data) {
}
My addLast(T data)
is completely empty because I genuinely have no idea where to start or whatsoever.
Can anyone please explain what I have to here.
Please also provide explanations since I'm trying my best to figure out how this works.