Data Structures & Algorithms

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

1/28

encourage image

There's no tags or description

Looks like no tags are added yet.

Last updated 1:32 PM on 9/27/26
Name
Mastery
Learn
Test
Matching
Spaced
Call with Kai
Chat

No analytics yet

Send a link to your students to track their progress

29 Terms

1
New cards

What type of data management does a Stack use?

Last In First Out (LIFO)

2
New cards

What does the push operation do to a stack?

Add’s an element to the top of a stack, in terms of a dynamic array means at the end of it.

3
New cards

What does the pop operation do to a stack?

Removes the last element from the top of the stack, which in dynamic array’s means removing the last element in the array.

4
New cards

What does the peek operation do to a stack?

It returns the top element of the stack without removing it.

5
New cards

What is the Big O for the peek operation in a stack?

O(1) operation; Constant Time Complexity

6
New cards

What is the Big O for the pop operation in a stack?

O(1) operation; Constant Time Complexity

7
New cards

What is the Big O for the push operation in a stack?

O(1) operation; Constant Time Complexity

8
New cards

Big O Notation

Describes the upper bound of an algorithm's growth rate, usually the worst-case time or space as input size grows.

9
New cards

Big Omega (Ω)

Describes the lower bound of an algorithm's growth rate, usually the best case.

10
New cards

Big Theta (Θ)

Describes a tight bound, meaning the algorithm grows at exactly that rate (both upper and lower bound).

11
New cards

Time Complexity

How the number of operations an algorithm performs grows as the input size grows.

12
New cards

Space Complexity

How much extra memory an algorithm needs as the input size grows.

13
New cards

O(1) – Constant Time

Runtime stays the same no matter the input size.

14
New cards

O(log n) – Logarithmic Time

Runtime grows slowly because the problem is cut in half each step.

15
New cards

O(n) – Linear Time

Runtime grows directly with input size.

16
New cards

O(n log n) – Linearithmic Time

Typical of efficient sorting algorithms.

17
New cards

O(n²) – Quadratic Time

Runtime grows with the square of the input, often from nested loops.

18
New cards

O(2ⁿ) – Exponential Time

Runtime doubles with each additional input element.

19
New cards

O(n!) – Factorial Time

Runtime grows extremely fast, from trying every possible ordering.

20
New cards

Worst Case

The maximum number of operations an algorithm could take for an input of size n.

21
New cards

Best Case

The minimum number of operations an algorithm could take for an input of size n.

22
New cards

Average Case

The expected number of operations over all possible inputs of size n.

23
New cards

Drop the Constants

In Big O, constant multipliers are ignored. O(2n) simplifies to O(n).

24
New cards

Drop Non-Dominant Terms

Only the fastest-growing term is kept. O(n² + n) simplifies to O(n²).

25
New cards

Amortized Time

The average cost per operation over a sequence of operations, even if some are occasionally expensive.

26
New cards

Adding Complexities

When steps happen one after another, add them: O(A + B).

27
New cards

Multiplying Complexities

When one step happens inside another (nested), multiply them: O(A × B).

28
New cards

Asymptotic Analysis

Studying how an algorithm behaves as input size approaches infinity.

29
New cards

Common Order (fastest to slowest)

O(1) < O(log n) < O(n) < O(n log n) < O(n²) < O(2ⁿ) < O(n!)