Alle boeken

Professioneel

Apps Over Coach Inloggen Begin met lezen

Computer Science · Begrippenlijst

Wat is Worst-case, best-case and average-case cost?

Ook bekend als: worst-case cost · best-case cost · average-case cost

Definition 13.6 University Computer Science — Year 1 · Hoofdstuk 13 — Asymptotic Analysis and Recurrences

For an algorithm whose cost on an input xx is C(x)C(x), and InI_n the finite set of inputs of size nn considered, the worst-case cost is max⁡x∈InC(x)\max_{x \in I_n} C(x), the best-case cost is min⁡x∈InC(x)\min_{x \in I_n} C(x), and the average-case cost is 1∣In∣∑x∈InC(x)\frac{1}{|I_n|}\sum_{x \in I_n} C(x).

Lees in het hoofdstuk →