Static Arrays Flashcards
What are the 2 most common operations on any data structure?
Reading and Writing
Reading data
Writing data
What are the 3 most common operations of an array?
Reading, Deletion, Insertion
What is a static array?
Static array is a fixed sized array
True or False: Is a static array not fixed in size?
False
Static array is a fixed sized array
It’s not possible to add another element on a static array because of how RAM works
True or False: Is a static array fixed in size?
True
Static array is a fixed sized array
True or False: Is it possible to add another element on a static array?
False
It’s not possible to add another element on a static array because of ho
Static array is a fixed sized array
True or False: Is not possible to add another element on a static array?
True
Static array is a fixed sized array
What is the biggest limitation of static array?
Static array is a fixed size array.
It means it’s not possible to change its size, unlike on dynamic array
True or False: Is the biggest limitation of static array is its fixed size nature?
True
Static array is a fixed size array.
It means it’s not possible to change its size, unlike on dynamic array
True or False: Is the biggest limitation of static array is its readability?
False
Its biggest limitation is its fixed in size
It’s possible to read each element of a static array as long as the indices (plural for index) are known
Static array is a fixed size array.
It means it’s not possible to change its size, unlike on dynamic array
What is the time complexity of reading a value of an element of static array if the right index is provided
O(1)
Constant time
In Big O, there are six major types of complexities (time and space):
Constant: O(1) Linear time: O(n) Logarithmic time: O(n log n) Quadratic time: O(n^2) Exponential time: O(2^n) Factorial time: O(n!)
What is the time complexity of writing a value of an element of static array if the right index is provided
O(1)
Constant time
In Big O, there are six major types of complexities (time and space):
Constant: O(1) Linear time: O(n) Logarithmic time: O(n log n) Quadratic time: O(n^2) Exponential time: O(2^n) Factorial time: O(n!)
True or False: O(1) is the time complexity of writing a value of an element of static array if the right index is provided
True
O(1) or Big O of 1 is the time complexity
In Big O, there are six major types of complexities (time and space):
Constant: O(1) Linear time: O(n) Logarithmic time: O(n log n) Quadratic time: O(n^2) Exponential time: O(2^n) Factorial time: O(n!)
True or False: O(n) is the time complexity of reading a value of an element of static array if the right index is provided
False
Big O of n or O(n) is the time complexity
O(n) represents linear time != O(1) represents constant time
In Big O, there are six major types of complexities (time and space):
Constant: O(1) Linear time: O(n) Logarithmic time: O(n log n) Quadratic time: O(n^2) Exponential time: O(2^n) Factorial time: O(n!)
True or False: O(1) is the time complexity of reading a value of an element of static array if the right index is provided
True
O(1) or Big O of 1 is the time complexity
In Big O, there are six major types of complexities (time and space):
Constant: O(1) Linear time: O(n) Logarithmic time: O(n log n) Quadratic time: O(n^2) Exponential time: O(2^n) Factorial time: O(n!)