Each of these data structures is designed for a different purpose and therefore has different performance characteristics.
Arrays -
Fixed size
Provide O(1) access to any element using its index.
Insertion/deletion in the middle requires shifting elements → O(n).
Stacks(LIFO - LAST IN, FIRST OUT) -
Access is limited to the top element.
Push and Pop operations → O(1).
No random access to middle elements.
Queues (FIFO – First In, First Out) -
Elements are added at the rear and removed from the front.
Enqueue (push) and Dequeue (pop) → O(1).
No direct access to middle elements.