What context can I use each word in?
Learn when and how to use these words with these examples!
recursively
Example
The function calculates the factorial of a number recursively. [recursively: adverb]
Example
The recursive algorithm divides the problem into smaller sub-problems until it reaches the base case. [recursive: adjective]
iteratively
Example
The program calculates the sum of an array iteratively. [iteratively: adverb]
Example
The iterative algorithm solves the problem by repeating a set of instructions until the solution is found. [iterative: adjective]
Good things to know
Which word is more common?
Iteratively is more commonly used than recursively in programming and computer science, especially for simple problems and data structures. However, recursively is still widely used for more complex problems and algorithms.
What’s the difference in the tone of formality between recursively and iteratively?
Both recursively and iteratively are technical terms used in programming and computer science, and are therefore formal in nature.