Workshop 6 - Linked Lists Flashcards

1
Q

Linked List

A

Collection of objects, called nodes.

Every node has two components, INFORMATION to be stored and REFRENCE to the next node.

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

Dyanmic Data Structure

A

Linked List is an example of this.

Number of nodes can grow if not fixed list.

Linked List can grow and shrink on demand.

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

Linked List advantages

A

Easily extendable or reduced to fit in data set.

Efficient - O(1) to insert/delete, ONCE LOCATED.

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

Linked List disadvantages

A

Does not allow direct access to individual items.

To find particular item, start at head and follow references till you get to the item. O(n)

Uses more memory. NEED to store a reference to next node.

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

Representation of Single Linked List in Java

A

recursive definition

data - integer

link - refrence table

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

Linked List example.

How do you know you reached end of queue?
How do you knkow if item removed?
What happens if you start at the start?

A

refrence link value = returns null value

you dont get acess to the other nodes.

you cannot. linking in one direction. no information about predessor.

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

Dummy Node

A

gives null value

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

Doubly Linked Liust

A

One more refrence, more flexibility.

more space disadvanatge,

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

SkipList

A

Probablistic data structure.
Based on set of parallel linked lists.
Improved efficiency.

SkipList data stored in order.
During search it parts of list can be skipped.

Efficiency O(log2n)

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