Arrays Flashcards
Learn fundamental knowledge related to arrays
1
Q
An Array is
A
A data structure that contains a group of elements.
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.
3
Q
Size
A
The number of elements in the array
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
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)