Stability of a general iterative algorithm