Runtime Analysis

0.0(0)
studied byStudied by 0 people
0.0(0)
full-widthCall with Kai
learnLearn
examPractice Test
spaced repetitionSpaced Repetition
heart puzzleMatch
flashcardsFlashcards
GameKnowt Play
Card Sorting

1/7

flashcard set

Earn XP

Description and Tags

From Dr. Pitmann's Lecture Slides

Study Analytics
Name
Mastery
Learn
Test
Matching
Spaced
Call with Kai

No study sessions yet.

8 Terms

1
New cards

Why does Big O Notation focus on worst case running time

It provides an upper bound on runtime, which is critical in time-sensitive or safety-critical applications. Worst-case guarantees the algorithm will never perform slower than the bound

2
New cards

What does Big O Measure?

It measures the asymptotic growth rate of an algorithm’s running time as the input size becomes very large

3
New cards

What is the meaning of O(n)

Linear time - the runtime grows proportionally with the input size.

4
New cards

What is the meaning of O(log n)

Logarithmic time - the runtime grows slowly, often due to repeatedly halving the input (binary search)

5
New cards

What is the meaning of O(n log n)

Linearithmic time - common in efficient sorting algorithms like mergesort and heapsort

6
New cards

What is the meaning of O(n²)

Quadratic time - often arises from nested loops where each loop runs n times

7
New cards

How do nested loops affect runtime?

Two simple nested loops over the same n elements result in O(n²) work, since the inner loop runs for each iteration of the outer loop

8
New cards

What is the meaning of O(1)

Constant time - the quickest, when you need to find an element in a HashMap