Topic 6 - Links Flashcards
1
Q
What is a linked data structure?
A
A linked data structure consists of items that are linked to other items
2
Q
Define: Singly linked list
A
each item points to
the next item
3
Q
Define: Doubly linked list
A
each item points to the next item and to the previous item
4
Q
How are the items in a linked List stored?
A
They are not stored in consecutive memory locations: the successor can be anywhere physically
5
Q
What does a node consist of?
A
A data portion and a link (pointer) to the next next node in the structure
6
Q
How is the first item (node) in the linked list accessed?
A
Via a front or head pointer. The linked list is defined by its head (this is its starting point)
7
Q
Go through steps for inserting a node at the front
A
- “node” points to the new node, “front” points to front node
- make new node point to first node.
- make “front” point to new front node