Lists and Linked Lists Flashcards

1
Q

Lists

A
  • an expandable array
  • indexes contents
  • automatically resizes its array
  • resizings are kept to a minimum by increasing the size more than needed
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
2
Q

Amortized time

A
  • as the list increases in size, the time spent copying arrays over is less than the actual number of elements
  • Resizing is O(n) but as the number of resizing increases, the time until the next one is reduced and the time cost having to resize decreases.
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
3
Q

List Resizing time

A
  • worst-case O(n)

- Expected O(1)

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

Linked Lists

A
  • expandable like a list
  • no backed by an array, no memory adjacency
  • node based data-structure
  • node holds value of the actual element and store memory address of the next node in the list
  • inserts and deletes are O(1)
  • Searching is O(n)
How well did you know this?
1
Not at all
2
3
4
5
Perfectly