Linked Lists Flashcards
1
Q
What does a linked data structure consist of?
A
Each item points to another item.
2
Q
Describe a singly linked list.
A
Each item points to the next item.
3
Q
Describe a doubly linked list.
A
Each item points to the next item and to the previous item.
4
Q
What are the advantages of a linked list.
A
Items don’t have to be stored in consecutive memory locations, so we can insert and delete items without shifting data.
Linked lists can grow and shrink dynamically.
5
Q
What’s a node.
A
A linked list is a sequence of items called nodes.
A node in a singly linked list consists of two fields (data and pointer).