Implementing a queue in Java is pretty common interview question. I surfed online and saw many implementations where they do fancy stuff like implementing queue interface and wr
public class Queue{
private LinkedList list=new LinkedList<>();
public void insert(T element){
list.addLast(element);
}
public void remove(){
list.removeFirst();
}
public int size(){
return list.size();
}
public T element(){
return list.getFirst();
}
}