Linked List Flashcards

You may prefer our related Brainscape-certified flashcards:
1
Q

What kind of structure is a linked list?

A

A dynamic data structure

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

What is an element in a list called?

A

Node

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

What things does a node store?

A

The data relating to the element

A pointer to the next node

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

Define traversing

A

To work your way systematically through the list

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

How do you traverse a list?

A

Start at the first node and follow each link until you reach the last node

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

can a linked list be ordered?

A

A linked list can be ordered or unordered

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

Where can you add a new node to an unordered list?

A

To the beginning or end of list

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

Is it more efficient to add nodes to the end of an unordered list?

A

No as you have to trans verse the list to find the last element

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

Steps for adding a new node to an unordered list

A

Create a new node
Set the pointer of the node to the value of the head pointer
Set the head pointer to the new node

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

Define the process for inserting a new element into a list ordered numerically

A

Create the new node
Traverse the list until you reach the node which has a value greater than the value of the new node
Set the value of the next pointer of the new node to the value of the next pointer of the previous node
Set the value of the next pointer of the previous node to point to the new node

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