Free Online Flashcard Deck

07 — Efficiency and Computational Complexity Free Online FlashCards

Study 07 — Efficiency and Computational Complexity 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 precisely specified procedure that produces a result from an input.

02
Front

What does n represent in complexity analysis?

Back

Input size is the quantity used to describe how large an instance is; for an array it may be the number of elements, while a graph may use |V| and |E|.

03
Front

What does time complexity measure?

Back

Time complexity describes how an algorithm’s required computational work grows as the input becomes larger, rather than stating a fixed elapsed time.

04
Front

What is auxiliary space?

Back

Auxiliary space is the additional memory an algorithm uses beyond the memory already required to store its input.

05
Front

What condition does binary search require?

Back

Binary search requires a sorted array because it decides which half of the remaining interval can be discarded.

06
Front

What is the typical complexity of indexed array access?

Back

Accessing an array element by index has Θ(1) time complexity because the operation takes constant time under the stated computational model.

07
Front

What does f(n) = O(g(n)) mean?

Back

Big-O notation gives an asymptotic upper bound: beyond some input size, f(n) grows no faster than a constant multiple of g(n).

08
Front

What does f(n) = Ω(g(n)) mean?

Back

Big-Omega notation gives an asymptotic lower bound: beyond some input size, f(n) grows at least as quickly as a constant multiple of g(n).

09
Front

What does f(n) = Θ(g(n)) mean?

Back

Big-Theta notation gives an asymptotically tight bound: f(n) is bounded both above and below by constant multiples of g(n).

10
Front

What is linear search’s best-case complexity?

Back

For linear search, the best case is Θ(1): the target is found at the first position, so only a constant amount of work is needed.

11
Front

What must average-case analysis specify?

Back

Average-case analysis requires a specified input distribution. If a target is equally likely at any position, successful linear search examines about (n+1)/2 elements on average.

12
Front

What is the complexity of two full nested loops?

Back

Two nested loops that each run n times perform n × n constant-time operations, giving Θ(n²) running time.