Arrays Flashcards

1
Q

What is an array?

A

A collection of elements, each identified by an index. Elements are stored in contiguous memory locations, meaning they are stored in sequence.

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

What is a static array?

A

Arrays that have a fixed size, determined at compile time. Once declared, the size cannot be changed.

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

What is a dynamic array?

A

Arrays that can change size during runtime. They can grow or shrink as needed, offering more flexibility.

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

What is the time complexity of accessing elements in an array?

A

O(1)

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

What is the time complexity of inserting an element at the end of an array?

A

O(1)

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

What is the time complexity of inserting an element at a specific index in an array?

A

O(n)

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

What is the time complexity of deleting an element at the end of an array?

A

O(1)

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

What is the time complexity of deleting an element at a specific index in an array?

A

O(n)

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

What is the time complexity of searching for a specific element in an array?

A

O(n)

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

What is the time complexity of searching for a specific element in a sorted array?

A

O(log n)

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

What is the time complexity of updating an element at a specific index in an array?

A

O(1)

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