Loading
A set of step-by-step instructions for solving a problem — like a recipe a computer can follow.
A finite, deterministic sequence of well-defined operations that takes an input and produces an output. Algorithms are evaluated by correctness, time complexity, and space complexity.
A computable function expressed as a finite procedure over a defined model of computation. Properties of interest include termination, asymptotic behavior in time/space, and amenability to parallelization or distribution.
function sum(nums) {
let total = 0;
for (const n of nums) total += n;
return total;
}