🐻
berkeley
  • #Despair
  • 16A/B
    • Thevenin and Norton Equivalence
    • Resistive Touchscreen
    • Trilateration and Correlation
    • RC Circuits & Transient Analysis
  • 61B
    • Testing
    • References in Java
    • Linked Lists in Java
    • Implementation Inheritance
    • Comparables and Iterators
    • Casting
    • Lists and Sets
    • Asymptotics
    • Trees
    • Hashing
    • PriorityQueue and Heap
    • Graphs, Tree Traversals
    • Tries
    • Sorting
  • Discrete Mathematics
    • Sets + Mathematical Notation
    • Logic and Proofs
    • Induction
    • Cryptography/RSA
    • Modular Arithmetic
    • Discrete Probability
  • Linear Algebra
    • Linear Equations
    • Matrix Algebra
    • Determinants
    • Vector Spaces
    • Eigenvectors and Eigenvalues
    • Projections and Orthogonality
    • SVD/PCA
  • Math 275 — Ordinary Differential Equations
    • Math 275 — Overview
    • Modeling via Differential Equations
    • Linear Systems
  • INTEGBI 35AC
    • Humans Came From Fish
    • Evolution's History
    • Typology
    • The Human Diaspora
  • 170
    • Basics
    • Divide and Conquer
    • Fast Fourier Transform
    • Graphs
    • Greedy
  • 61C
    • Pointers and Memory
    • Floating Point
    • Compliation, Assembly, Linking, Loading
    • RISC-V, Assembly
Powered by GitBook
On this page
  • Scaling
  • Notation
  • Two Useful Things

Was this helpful?

  1. 61B

Asymptotics

PreviousLists and SetsNextTrees

Last updated 3 years ago

Was this helpful?

Scaling

The scaling of an algorithm refers to its behavior in terms of speed and resource consumption as the number of things it has to process increases.

We want our "interpretation" of how long an algorithm takes to be mathematical, as well as consider only the worst case.

Notation

Symbol

Use

Denotes the family of functions that grow with the order specified in the notation. Mathematically, it means that given , there are two positive constants , where .

If you think of big theta as equals, you can think of big O as less than or equal. This just means that , then for some positive integer . Usually represents the worst-case scenario.

Opposite of and represents the best case scenario. Not really used too often.

Two Useful Things

Runtime

Summation

Sum of first natural numbers 1 + 2 + 3 + 4 ... + N

Sum of first powers of 2 1 + 2 + 4 + 8 ... + N

Θ(N)\Theta(N)Θ(N)
R(N)∈Θ(f(N))R(N) \in \Theta(f(N))R(N)∈Θ(f(N))
k1,k2k_1,k_2k1​,k2​
k1f(N)≤R(N)≤k2f(N)k_1f(N)\leq R(N)\leq k_2f(N)k1​f(N)≤R(N)≤k2​f(N)
O(N)O(N)O(N)
R(N)∈O(f(N))R(N) \in O(f(N))R(N)∈O(f(N))
R(N)≤k2f(N)R(N)\leq k_2f(N)R(N)≤k2​f(N)
k2k_2k2​
Ī©(N)\Omega(N)Ī©(N)
O(N)O(N)O(N)
Θ(N2)\Theta(N^2)Θ(N2)
Θ(N)\Theta(N)Θ(N)