Static Arrays Flashcards

1
Q

What are the 2 most common operations on any data structure?

A

Reading and Writing

Reading data
Writing data

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

What are the 3 most common operations of an array?

A

Reading, Deletion, Insertion

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

What is a static array?

A

Static array is a fixed sized array

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

True or False: Is a static array not fixed in size?

A

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

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

True or False: Is a static array fixed in size?

A

True

Static array is a fixed sized array

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

True or False: Is it possible to add another element on a static array?

A

False

It’s not possible to add another element on a static array because of ho

Static array is a fixed sized array

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

True or False: Is not possible to add another element on a static array?

A

True

Static array is a fixed sized array

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

What is the biggest limitation of static array?

A

Static array is a fixed size array.
It means it’s not possible to change its size, unlike on dynamic array

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

True or False: Is the biggest limitation of static array is its fixed size nature?

A

True

Static array is a fixed size array.
It means it’s not possible to change its size, unlike on dynamic array

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

True or False: Is the biggest limitation of static array is its readability?

A

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

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

What is the time complexity of reading a value of an element of static array if the right index is provided

A

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!)
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
12
Q

What is the time complexity of writing a value of an element of static array if the right index is provided

A

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!)
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
13
Q

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

A

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!)
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
14
Q

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

A

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!)
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
15
Q

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

A

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!)
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
16
Q

True or False: O(n log n) is the time complexity of writing a value of an element of static array if the right index is provided

A

False

Big O of n log n or O(n log n) is the time complexity

O(n log n) represents logarithmic 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!)
17
Q

How does deletion of an element of an array work on memory?

A

The element of an array is actually not being deleted but instead its being overwritten by an arbitrary value

18
Q

True or False: Can you actually delete an element of an array

A

False

The element of an array is actually not being deleted but instead its being overwritten by an arbitrary value

19
Q

True or False: It’s not possible to actually delete an element of an array

A

True

The element of an array is actually not being deleted but instead its being overwritten by an arbitrary value