linked list over array

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


Leave a Reply

Notify of