dsa quiz 5

0.0(0)
studied byStudied by 5 people
full-widthCall with Kai
GameKnowt Play
learnLearn
examPractice Test
spaced repetitionSpaced Repetition
heart puzzleMatch
flashcardsFlashcards
Card Sorting

1/5

encourage image

There's no tags or description

Looks like no tags are added yet.

Study Analytics
Name
Mastery
Learn
Test
Matching
Spaced

No study sessions yet.

6 Terms

1
New cards

If every recursive call results in two or more recursive call, then the recursive method (algorithm) is said to have a/an [blank] recursion

excessive

2
New cards

[blank] is a technique for returning to a given position after trying other avenues that are unsuccessful in solving a particular problem

backtracking

3
New cards

[blank] is a type of recursion in which there is only one recursive call at the very end of a method implementation

tail recursion

4
New cards

what are the five information that are usually contained in the activation record of a function?

values for all parameters

local variables

return address

dynamic link

returned value

5
New cards

fibonacci code

int fib (int n ) {

if (n == 0) {

return 0;

} else if (n == 1) {

return 1;

} else {

return fib(n-1) + fib(n-2);

}

}

6
New cards

exponent

int exponent (int x, int n) {
if (n == 0) {

return 1;

} else {

return x * exponent(x, n-1);

}
}