Linked List Flashcards

1
Q

Accessing the head?

A

O(1)

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

Accessing the tail? (2)

A
  1. O(N) without a reference to the tail.

2. O(1) with a reference to the tail.

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

Accessing a middle node?

A

O(N)

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

Inserting or Removing the head?

A

O(1)

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

Inserting or Removing the tail? (2)

A
  1. O(N) to access + O(1) to insert/remove. Without a stored tail reference.
  2. O(1) to insert/remove. With a stored tail reference.
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
6
Q

Inserting or Removing a middle node?

A
  1. O(N). O(N) to access + O(1) to insert/remove.
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
7
Q

Searching for a value?

A

O(N)

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