Linked List (Module 3.3) Flashcards

1
Q

What is a dynamic linear data structure where each element (node) contain data and a pointer?

A

linked list

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

What is a user-defined data type that holds data and pointer?

A

node

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

Do linked lists store elements in memory locations?

A

No!

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

What is the key to dynamic growth of a linked list?

A

the pointer to the next (and previous) nodes

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

A pointer may be set to ______, indicating the end of a linked list

A

null

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

A linked list uses ___________ memory spaces

A

non-continuous

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

Which type of linked list has each node point to the next node, but can’t go backwards?

A

singly linked list

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

Which type of linked list has two pointers for each node that point to next and previous node?

A

doubly linked list

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

What is a limitation of the doubly linked list?

A

It requires more memory for each additional pointer

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

Which linked list has the last node point to the first node, creating a loop?

A

circular linked list

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

Can a circular list be singly or doubly linked?

A

Yes!

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

What is the limitation of the circular linked list?

A

traversal need more logic to detect cycles

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

What are the two special pointers in linked list?

A

head and tail

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

Which special pointer points to the first node in the linked list?

A

head

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

Is the head or tail a node itself?

A

No!

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

The linked list is empty, where do the head or tail point to?

17
Q

The head and tail can be considered a ________ to the start and end of a linked list

18
Q

How would you create a node?

A

Node head = new Node(10);

19
Q

How would you point a second node to the third node?

A

second.next = third;

20
Q

What are the advantages of a linked list?

A

dynamic size, efficient insertion/deletion, memory efficiency

21
Q

What are the disadvantages of a linked list?

A

random access, memory overhead, complexity