CS 1301 - Big O Notation

0.0(0)
studied byStudied by 0 people
learnLearn
examPractice Test
spaced repetitionSpaced Repetition
heart puzzleMatch
flashcardsFlashcards
Card Sorting

1/16

flashcard set

Earn XP

Description and Tags

Special topics #1

Study Analytics
Name
Mastery
Learn
Test
Matching
Spaced

No study sessions yet.

17 Terms

1
New cards

Big O Notation

Represents the time needed for an algorithm to complete a task as its input size grows

2
New cards

n in Big O notation

represents the amount of data (aka data size)

3
New cards

O(1)

AKA constant time; same number of operations regardless of input size

4
New cards

Accessing an item in a list by index

example of O(1) notation

5
New cards

O(log n)

AKA logarithmic time; task grows very slowly as the input grows

6
New cards

binary search

examples of O(log n) notation

7
New cards

O(n)

AKA linear time; work grows in direct proportion to the input

8
New cards

looping through items in a list

examples of O(n) notation

9
New cards

O(n log n)

AKA loglinear time; similar to linear notation (slightly slower)

10
New cards

quicksort and mergesort

examples of O(n log n) notation

11
New cards

O(n2) notation

AKA quadratic time; work grows like n*n

12
New cards

insertion sort, bubble sort, selection sort

Examples of O(n2) notation

13
New cards

O(2n) notation

AKA exponential time; doubles everytime the input increases

14
New cards

trying all password combinations

example(s) of n) notation

15
New cards

Cubic (polynomial) order

refers to algorithms whose time complexity can be expressed as a polynomial function of the input size, typically represented as O(n3) where k is a constant

16
New cards

Factorial order

describes algorithms with time complexity of O(n!), indicating that the runtime grows factorially with the input size, usually seen in problems involving permutations.

17
New cards

Order of fastest growth

constant > logarithmic > linear > loglinear > quadratic > exponential > factorial