Free Online Flashcard Deck

01 Algorithm Analysis and Big-O Notation Free Online FlashCards

Study 01 Algorithm Analysis and Big-O Notation with 12 free online flashcards. Review key terms, definitions, and concepts with this interactive flashcard deck.

12 cards
01
Front

What is an algorithm?

Back

An algorithm is a finite, precise sequence of steps that transforms input into output to solve a problem.

02
Front

What does an abstract data type specify?

Back

An ADT specifies the values and operations a type supports without prescribing how those operations are implemented.

03
Front

What is a representation invariant?

Back

A representation invariant is a condition that must remain true about a data structure’s internal state.

04
Front

Which elements commonly support a correctness argument?

Back

A correctness proof uses a precondition, postcondition, invariant, and termination argument to show that an algorithm produces the required result and stops.

05
Front

What are the three steps for proving a loop invariant?

Back

The three loop-invariant steps are initialization, maintenance, and termination.

06
Front

Why must input size be defined precisely?

Back

The input-size variable depends on the problem: it may count array elements, string characters, tree nodes, graph vertices, edges, or integer-representation bits.

07
Front

What does time complexity measure?

Back

Time complexity describes how the number of basic operations grows with input size; it does not usually predict exact elapsed seconds.

08
Front

What does worst-case complexity measure?

Back

Worst-case analysis measures the greatest work for any input of size nn, providing a guarantee for every input of that size.

09
Front

What is auxiliary space?

Back

Auxiliary space is the additional memory used by an algorithm beyond the memory needed to store its input.

10
Front

What does Big-O notation express?

Back

Big-O gives an eventual asymptotic upper bound: for suitable constants c>0c>0 and n0n_0, 0≤f(n)≤c g(n)0\le f(n)\le c\,g(n) for all n≥n0n\ge n_0.

11
Front

When is a function Θ(g(n))\Theta(g(n))?

Back

A function is Θ(g(n))\Theta(g(n)) when it is both O(g(n))O(g(n)) and Ω(g(n))\Omega(g(n)), giving an asymptotically tight bound.

12
Front

How do common growth classes rank from slower to faster?

Back

From slower to faster growth, the listed classes are Θ(1)\Theta(1), Θ(log⁡n)\Theta(\log n), Θ(n)\Theta(n), Θ(nlog⁡n)\Theta(n\log n), Θ(n2)\Theta(n^2), Θ(2n)\Theta(2^n), and Θ(n!)\Theta(n!).