When to use what type of repetition in a program

Using recursion will make your code easier to understand and shorter than other repetitions, but sometimes it’s just not the best way to do it.You have to make the code longer and with more statements.If you want your code to be super effective all the time you have to be very carful about what type of repetition you are going to use, because yes, the recursion is easier but when time is something to be considered you shouldn’t use the recursion type, because it takes more time than other types of repetition.

CC BY 4.0 When to use what type of repetition in a program by Jorge Padilla is licensed under a Creative Commons Attribution 4.0 International License.

Comments are closed.