Lists Flashcards

1
Q

What are the 4 most important differences between singly and doubly-linked lists?

A
  1. Singly-linked lists only have a reference to the “next” node
  2. Doubly-linked lists have a reference to both the “previous” and “next” node
  3. Singly-linked lists have O(n) complexity when deleting nodes at the tail
  4. Doubly-linked lists have O(1) complexity when deleting nodes at the tail
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
2
Q

True or False

Both arrays and linked lists allocate memory in a sequential manner

A

False

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

What is the formula to calculate the length of a sliding window?

A

right - left + 1

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