Recall & Review
beginner
What is a doubly linked list?
A doubly linked list is a type of linked list where each node has two pointers: one to the next node and one to the previous node. This allows traversal in both directions.
Click to reveal answer
beginner
Why might we prefer a doubly linked list over a singly linked list?
Because doubly linked lists allow easy backward traversal and efficient deletion of nodes without needing to traverse from the head, unlike singly linked lists.
Click to reveal answer
beginner
What is a disadvantage of doubly linked lists compared to singly linked lists?
Doubly linked lists use more memory because each node stores an extra pointer to the previous node, and operations can be slightly slower due to managing two pointers.
Click to reveal answer
intermediate
How does deletion of a node differ between singly and doubly linked lists?
In singly linked lists, to delete a node, you must find the previous node by traversing from the head. In doubly linked lists, you can access the previous node directly, making deletion faster.
Click to reveal answer
beginner
Can doubly linked lists be traversed backwards? Why is this useful?
Yes, doubly linked lists can be traversed backwards because each node has a pointer to the previous node. This is useful for operations like reverse iteration or undo functionality.
Click to reveal answer
What extra pointer does a doubly linked list node have compared to a singly linked list node?
✗ Incorrect
A doubly linked list node has a pointer to the previous node, allowing backward traversal.
Which operation is faster in a doubly linked list compared to a singly linked list?
✗ Incorrect
Deleting a node is faster because the previous node is directly accessible in a doubly linked list.
What is a downside of doubly linked lists?
✗ Incorrect
Doubly linked lists use more memory because each node stores two pointers.
Which traversal is NOT directly supported by a singly linked list?
✗ Incorrect
Singly linked lists do not support backward traversal because nodes only point forward.
Why might you choose a singly linked list over a doubly linked list?
✗ Incorrect
Singly linked lists use less memory per node, making them better when memory is limited.
Explain the main reasons to use a doubly linked list instead of a singly linked list.
Think about how nodes connect and how operations like deletion work.
You got /3 concepts.
Describe the trade-offs between singly and doubly linked lists in terms of memory and operation efficiency.
Consider what each node stores and how it affects traversal and deletion.
You got /4 concepts.
