- 2071 Bhadra · 2 marks
Characteristics of recursion
Short answer
Main characteristics: the function calls itself, has a base case, works on smaller inputs, uses a stack for each call, divides a problem into similar subproblems, and usually costs more time and memory but gives short, clear code.
What are the main characteristics of recursion?
The main characteristics of recursion are:
- Self-call: the function calls itself, directly or through another function.
- Base case: a stopping condition that is solved without a further recursive call.
- Progress toward the base case: each call uses a smaller or simpler input.
- Stack use: each call has its own copy of parameters and local variables, stored in a stack frame; results are combined while returning.
- Divide and conquer: a big problem is divided into similar smaller problems.
- Costs: usually needs more memory and time than iteration, and may cause stack overflow if too deep, but gives short and clear code.
✓ Answer checked by Claude Opus 5.5 (high effort)
Related questions
- Main characteristics of 3d transition elements · Engineering Chemistry, chapter 5
- Contour terms and characteristics with sketch · Surveying II, chapter 4 · asked 3×
- Characteristics and advantages of OOP · Software Engineering, chapter 2
- Characteristics of successful entrepreneurs · Entrepreneurship Development, chapter 1