Computer Science I / Integrated Algorithm Design Practice
Practice question · True or false

The fastest algorithm for a problem in the abstract is the right choice regardless of the data and constraints in front of you.

Hints
  1. Consider input that is already nearly sorted, or a machine with little memory.
  2. Asymptotic speed is one constraint among several.
Show the answer

False

Why

False. Insertion sort beats quicksort on nearly-sorted input; an in-place algorithm beats a faster one that needs O(n) extra memory on a device that has none; a simpler algorithm beats a faster one nobody on the team can maintain. The problem, the data and the constraints together decide.

Read the lesson: Integrated Algorithm Design Practice →

Practise Integrated Algorithm Design Practice

The app has 5 more questions on this lesson, and keeps your place in the course. Computer Science I is free to start.

More questions on Integrated Algorithm Design Practice