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

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
2
Q

Define: Singly linked list

A

each item points to

the next item

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
3
Q

Define: Doubly linked list

A

each item points to the next item and to the previous item

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
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

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
5
Q

What does a node consist of?

A

A data portion and a link (pointer) to the next next node in the structure

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
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)

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
7
Q

Go through steps for inserting a node at the front

A
  1. “node” points to the new node, “front” points to front node
  2. make new node point to first node.
  3. make “front” point to new front node
How well did you know this?
1
Not at all
2
3
4
5
Perfectly