An algorithm is a procedure for accomplishing some task which, given an initial state, will terminate in a defined end-state.
The computational complexity and efficient implementation of the algorith are important in computing and this depends on suitable data structures.
An algorithm is a sequence of unambiguous instructions for solving a problem, i.e., for obtaining a required output for any legitimate input in a finite amount of time.