Question: Consider the function below to reverse the substring of S from position i to j. If S were defined as a string abedefg then reversestring



Consider the function below to reverse the substring of S from position i to j. If S were defined as a string "abedefg" then reversestring ( S,0,len(S)1) function would return "gfedcba" reversestring (S,3,4) function would return "abcedfg" Function: What is the recurrence relation of reversestring? T(n)=k+2T(n1)T(n)=k+T(n1)T(n)=k+nT(n)=k+T(n2) None of the other answers are correct The atoi() function takes a string (which represents an integer) as an argument and returns its value. Consider the following two recursive implementations atoiR1 () and atoiR2 (\}). What is the time complexity of ato iR2? O(n) O(2n) O(log(n)) O(n!) O(n2) Consider a recursive function findBinary () that prints every possible bit strings of every n-digit binary number that contains more zeros than ones. This function has four parameters, one string, and three 32 -bit integers as follow: findBinary (bitstr, n, ones, zeros). For example: findBinary ("",3,0,0) "100" "010" "001" "000" Which of the follow statement is true about findBinary? findBinary is not tail recursive but can be made into tail recursive function findBinary is not tail recursive but cannot be made into tail recursive function findBinary is not tail recursive None of the other answers are correct findBinary is tail recursive
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
