Back to marketplace

2.2.1 programming techniques

No description yet. This curated deck is ready for daily study.

Total cards: 7•Content version: v4•Public deck•Updated: 8/1/2026

Card preview (7)

#1
Front (Question)

what is recursion?

Back (Answer)

a function that calls on itself it has a terminating/base case it also has a general case

#2
Front (Question)

how do you convert a recursive algorithm to an iterative algorithm?

Back (Answer)

• the opposite of the base case is used for the while loop condition • the parameters in the recursive calls of the function are set as changing the variables

#3
Front (Question)

what are the advantages of recursive algorithms?

Back (Answer)

• uses less lines of code • well suited to certain problems/elegant solution

#4
Front (Question)

what are some disadvantages of recursive algorithms?

Back (Answer)

• risk of stack overflow • uses more memory

#5
Front (Question)

how can you trace through a recursive algorithm?

Back (Answer)

• use a table (if provided) and write each function call, the value of the parameters and the return • write each line of code and write the decisions (true/false) next to it. Then do this for the next call of the function with the correct values. finally, write the return values of each instance of the function call

#6
Front (Question)

What are some examples of recursive algorithms?

Back (Answer)

• merge sort • binary tree search • calculating factorials

#7
Front (Question)

Back (Answer)