

0 / 2 embers
0 / 3000 xp
click for more info
Complete a lesson to start your streak
click for more info
Difficulty: 5
click for more info
Not enough gems
Cost: 6 gems
1: Linked Lists
incomplete
2: Linked List vs. List
incomplete
3: Generators
incomplete
4: Iterating
incomplete
5: Add to Tail
incomplete
6: Add to Head
incomplete
7: Linked List Queue
incomplete
8: Remove from Head
incomplete
9: Linked List Queue Quiz
incomplete
Back
ctrl+,
Next
ctrl+.
This lesson's interactive features are locked, please to keep using them
Let's recap a few key points about linked lists and queues:
The problem with our array (normal Python list) implementation of a queue was that it had O(n) push operations.
The linked list implementation of a queue has O(1) push operations.
Linked lists are usually a worse choice than standard arrays because:
They are less performant due to more memory overhead
They are more complex to work with, debug, and reason about
They have no random access (indexing to a specific element)
Doubly linked lists are a better choice than arrays in very specific circumstances because they have O(1) insertions and deletions at both ends of the list.