An algorithm is a finite set of instructions that accomplish a task.