Section 5: Dynamic Arrays — Operations and Complexity (49–60)

0.0(0)
Studied by 0 people
call kaiCall Kai
learnLearn
examPractice Test
spaced repetitionSpaced Repetition
heart puzzleMatch
flashcardsFlashcards
GameKnowt Play
Card Sorting

1/11

encourage image

There's no tags or description

Looks like no tags are added yet.

12 Terms

1
New cards

Dynamic array size operation time complexity

O(1)O(1)

2
New cards

Dynamic array get operation time complexity

O(1)O(1)

3
New cards

Dynamic array set operation time complexity

O(1)O(1)

4
New cards

Dynamic array contains operation time complexity

O(n)O(n)

5
New cards

Dynamic array indexOf operation time complexity

O(n)O(n)

6
New cards

Amortized time complexity of appending to a dynamic array

O(1)O(1)

7
New cards

Worst-case time complexity of appending to a dynamic array when resizing

O(n)O(n), because existing elements must be copied.

8
New cards

Time complexity of inserting at an arbitrary index in a dynamic array

O(n)O(n), because elements may need to shift.

9
New cards

Time complexity of removing an element at an index in a dynamic array

O(n)O(n), because elements may need to shift.

10
New cards

Time complexity of increasing dynamic array capacity

O(n)O(n), because existing elements must be copied.

11
New cards

Space complexity of a dynamic array storing nn elements

O(n)O(n)

12
New cards

Reason indexed operations are efficient in a dynamic array

The backing array allows direct access by index.