Services
Discover
Homeschooling
Ask a Question
Log in
Sign up
Filters
Done
Question type:
Essay
Multiple Choice
Short Answer
True False
Matching
Topic
Computing
Study Set
Problem Solving with C++
Quiz 14: Recursion
Path 4
Access For Free
Share
All types
Filters
Study Flashcards
Question 21
Multiple Choice
The recursive definition of a Fibonacci Number is Fn) = Fn-1) + Fn-2) ,where F0) =1 and F1) =1.What is the value of Fib5) ?
Question 22
Multiple Choice
What is the output of the following code fragment? Int f1int base,int limit) { Ifbase > limit) Return -1; Else Ifbase == limit) Return 1; Else Return base * f1base+1,limit) ; } Int main) { Cout << f12,4) <<endl; Return 0; }
Question 23
Multiple Choice
In order for the binary search to work correctly
Question 24
Multiple Choice
A stack exhibits _________ behavior.
Question 25
Multiple Choice
Given the following recursive function definition,what is the stopping case? Void towerschar source,char dest,char help,int numDisks) { IfnumDisks<1) { Return; } Else { Towerssource,help,dest,numDisks-1) ; Cout << "Move disk from " << source << " to " <<dest<<endl; Towershelp,dest,source,numDisks-1) ; } }
Question 26
Multiple Choice
What is wrong with the following recursive function? It should print out the array backwards. Void printint array[],int start,int size) { Ifstart == size) Return; Else { Printarray,start-1,size) ; Cout << array[start] << endl; } }