1) A function is said to be recursive if it call itself again and again within its body whereas iterative functions are loop based imperative functions.
2) Recursion uses stack whereas iteration does not use stack.
3) Recursion uses more memory than iteration as its concept is based on stacks.
4)Recursion is comparatively slower than iteration due to overhead condition of maintaining stacks.
5)Recursion makes code smaller and iteration makes code longer.
2) Recursion uses stack whereas iteration does not use stack.
3) Recursion uses more memory than iteration as its concept is based on stacks.
4)Recursion is comparatively slower than iteration due to overhead condition of maintaining stacks.
5)Recursion makes code smaller and iteration makes code longer.
No comments:
Post a Comment