The Student Room Group

what are three types of iteration?

what are three types of iteration?in computer science
tail-recursion, while loops, and for loops
while loop - check loop condition before executing

until loop - check loop condition after executing (i.e. always executes at least once)

for loop - when you know you want to execute a specific number of times

needless to say different languages implement these a bit differently
---
BTW tail recursion is one type of recursion and recursion is a different can of worms

Quick Reply

Latest

Trending

Trending