which should be used: array vs linked list?
问题 I am planning to implement a bounded queue without using the Queue<T> class. After reading pros and cons of Arrays and LinkedList<T> , I am leaning more towards using Array to implement queue functionality. The collection will be fixed size. I just want to add and remove items from the queue. something like public class BoundedQueue<T> { private T[] queue; int queueSize; public BoundedQueue(int size) { this.queueSize = size; queue = new T[size + 1]; } } instead of public class BoundedQueue<T>