When to use linked list over an array for Stack or Queue ?
In our previous articles we have see how to implement the following.
You may face the following interview question on when to choose Linked List over Arrays
When to use a Linked List over Arrays for Stack and Queue implementation ?
If you are not clear or could not predict how much data you need to store in Stack or Queue, then Linked List gives you more flexibility compared to Array. Note that both are fast, so speed is not the major point to consider while choosing between Linked List or Arrays.
Recommended Posts
- Simple Linked List Example
- Array Vs Linked List Efficiency
- Double-Ended Lists Example
- Find and delete specified ‘Link’ from Linked List
- Priority Queue: Array Based Example
- Deque: Double-ended queue is a versatile data structure
- Queue No-count approach and Implementation
- Circular Queue using Array (Wrapping Around)
- Reverse a string or word using Stack
- Delimiter Matching using Stack