Courses / Computer Science I
Algorithmics

What Makes an Algorithm Good

Computer Science I 172 words Free to read

Beyond It Works

An algorithm is a finite, well-defined sequence of steps solving a problem. Correctness and efficiency decide its true worth.

QualityDefinitionWhy It Matters
CorrectnessRight output for every valid inputEssential; wrong answers are useless
EfficiencyGrowth of time/space via Big-ODetermines scale limits
ClarityReadability and simplicityPrevents implementation bugs

An algorithm must be finite (it terminates) and definite (unambiguous steps).

We write in pseudocode to reason precisely without language syntax distractions.

Three candidates for one task, scored on three independent axes

Correctness First

A common pitfall is optimizing for speed before establishing correctness. A fast algorithm giving wrong answers is worthless; a correct-but-slow one at least works.

The Golden Rule: Get it right first, argue or prove why every edge case is handled, and only then make it efficient.

Premature optimization of an incorrect method wastes effort on the wrong thing. Always prioritize a verifiable solution over a clever, obscure one.

Practise this lesson

The explanation above is free to read. The graded practice for this lesson lives in the Tryals app.

11practice questions
2interactive scenes

Algorithmics