Question: 1. What does the following recursive function do, in general ? bool Mistery (char s[], int low, int high) { } if (high y)
1. What does the following recursive function do, in general ? bool Mistery (char s[], int low, int high) { } if (high y) return (x + y); else return fun (x + 1, y - 1); What is the output of the following statements ? a. cout < < fun ( 7, 12); b. cout < < fun (4,8); 3. Consider a function, power, that takes as parameters two integers x and y such that x is nonzero and returns xy. Use the following definition to calculate xv. If y >= 0: If y 1 power (x,y) = 1/( power (x, y)) a. Write an iterative version of the power function above b. Write an recursive version of the power function above
Step by Step Solution
3.37 Rating (150 Votes )
There are 3 Steps involved in it
1 The recursive function Mistery checks if a given character array s is a palindr... View full answer
Get step-by-step solutions from verified subject matter experts
