Question
Answer all questions or points won't be awarded! Thanks! Question 1 (1 point) Given the following 2 functions - what is the value of calling
Answer all questions or points won't be awarded! Thanks!
Question 1 (1 point)
Given the following 2 functions - what is the value of calling fb(4,2)? function fa(x, y){ if (y == 0) return 0; return (x + fa(x, y-1)); } function fb(x, y) { if (y == 0) return 1; return fa(x, fb(x, y-1)); }
Question 4 (1 point)
Given the following 2 functions - what is the value of calling fb(3,3)? function fa(x, y){ if (y == 0) return 0; return (x + fa(x, y-1)); } function fb(x, y) { if (y == 0) return 1; return fa(x, fb(x, y-1)); }
Question 4 options:
Question 5 (1 point)
What is the value of f5(3,5,6) for the following function; function f5(n, a, b){ if (n
Question 5 options:
Question 6 (1 point)
What is the return value of f2(25) ? function f2(n) { if (n == 0) return ""; return n % 2 + " " + f2(parseInt(n/2)); }
Question 6 options:
| |||
| |||
| |||
| |||
| |||
|
Question 7 (1 point)
What is the output of the following function if called with the argument doFun2(7)? function doFun2(n) { // Enqueue is equivalent to push, Dequeue is equivalent to shift var q = []; q.push(0); q.push(1); for (var i = 0; i
Question 7 options:
Question 8 (1 point)
What is the output of the following function with the input "( ( ( ) )" function g(s) { var a = s.split(""); var b = []; for (var i = 0; i 0) b.pop();} } return b.length; }
Question 8 options:
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started