Arrays Flashcards

Learn fundamental knowledge related to arrays

1
Q

An Array is

A

A data structure that contains a group of elements.

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

Static array

A

A random-access data structure that is of fixed size. “Adding” or “deleting” an element from an array requires creating a new array.

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

Size

A

The number of elements in the array

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

Static Array Strengths

A
  • The item lookup for arrays is very quick - O(1)

- Arrays are a simple data structure with a very low memory footprint

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

Static Array Weaknesses

A
  • Arrays have to be implemented in contigous memory
  • Adding or deleting elements to the array is O(n), where n is the number of elements in the array
  • Arrays do not allow for the quick rearrangement of elements
  • Searching in the array for an entry with particular attributes is O(n)
How well did you know this?
1
Not at all
2
3
4
5
Perfectly