Free Online Flashcard Deck

1 Algorithm Analysis and Big-O Notation Free Online FlashCards

Study 1 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, precisely defined sequence of steps for solving a problem.

02
Front

How do an ADT and data structure differ?

Back

An ADT specifies values and permitted operations without describing implementation; a data structure is the concrete representation that implements it.

03
Front

What does input size nn measure?

Back

Input size is the measure of problem scale, such as the number of array elements, string characters, graph vertices, or representation bits.

04
Front

What is a cost model?

Back

A cost model identifies which operations count as basic units of work, often treating arithmetic, assignment, comparison, and array access as constant-time.

05
Front

What are the time and auxiliary space costs of summing an array?

Back

The sum loop has runtime Θ(n)\Theta(n) because it processes each element once, and auxiliary space Θ(1)\Theta(1) because it uses only a fixed amount of extra memory.

06
Front

What is the complexity of two nested nn-iteration loops?

Back

Two independent nested loops that each run nn times perform Θ(n2)\Theta(n^2) work because the iteration counts multiply.

07
Front

What is auxiliary space?

Back

Auxiliary space is memory used beyond the input; total space includes both the input storage and the algorithm’s additional memory.

08
Front

What are sequential search’s best and worst cases?

Back

For sequential search, the best case is Θ(1)\Theta(1), while the worst case is Θ(n)\Theta(n) when the target is last or absent.

09
Front

What does Big-O notation express?

Back

Big-O is an asymptotic upper bound: eventually, T(n)≤cf(n)T(n)\leq c f(n) for positive constants cc and n0n_0.

10
Front

When is Θ(f(n))\Theta(f(n)) appropriate?

Back

Big-Θ\Theta is a tight asymptotic bound because the function is both an asymptotic upper bound and an asymptotic lower bound.

11
Front

How is a runtime expression simplified asymptotically?

Back

To simplify an asymptotic expression, remove constant multipliers and retain the fastest-growing term; thus 4n2+3n+9=Θ(n2)4n^2+3n+9=\Theta(n^2).

12
Front

Why is binary search Θ(log⁡n)\Theta(\log n)?

Back

Binary search has runtime Θ(log⁡n)\Theta(\log n) because each step halves the remaining input, giving the recurrence T(n)=T(n/2)+Θ(1)T(n)=T(n/2)+\Theta(1).