An algorithm is widely used in mathematics, computing and related subjects. It is basically a sequence of finite instructions that are used for calculations and data processing. It is an effective method where a list of well defined instructions are used for completing a task.

When an initial state is given, an algorithm proceeds through a series of successive states that eventually terminates at the end state. The transition is normally deterministic in nature.