An algorithm is a set of steps to accomplish a specific task or solve a problem. It has a well-defined sequence of steps, will produce an output, and will eventually terminate. An algorithm describes the precise steps to solve a computational procedure from an input to an output in a finite number of steps. Examples of algorithms include step-by-step directions for driving to a friend's house or brushing your teeth.