What is an algorithm?
AnswerA step-by-step procedure for solving a problem
An algorithm is a finite set of clear steps that solves a problem or completes a task.
Coding · Facts & stats
7 fact-checked facts about algorithms, each with the reason behind it. 5 more are in today's round and join this page after it closes.
AnswerA step-by-step procedure for solving a problem
An algorithm is a finite set of clear steps that solves a problem or completes a task.
AnswerIt must be sorted
Binary search halves the search space each step, which only works on sorted data.
AnswerAl-Khwarizmi
It derives from the Latinized name of the 9th-century Persian mathematician Muhammad ibn Musa al-Khwarizmi.
AnswerO(n log n)
Merge sort splits the list in half repeatedly and merges, taking n log n time in all cases.
AnswerQueue
A queue works like a line of people: the first to join is the first served.
AnswerO(n²)
Quicksort averages O(n log n) but degrades to O(n²) when pivots split the list very unevenly.
AnswerThe greatest common divisor of two numbers
Euclid's algorithm repeatedly takes remainders to find the largest number dividing both inputs.