Question
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
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 1 options:
Save
Question 2 (1 point)
What is the value of f5(3,4,5) for the following function; function f5(n, a, b){ if (n
Question 2 options:
Save
Question 3 (1 point)
What is the return value of f2(17) ? function f2(n) { if (n == 0) return ""; return n % 2 + " " + f2(parseInt(n/2)); }
Question 3 options:
| |||
| |||
| |||
| |||
| |||
| |||
|
Save
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:
Save
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:
Save
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:
| |||
| |||
| |||
| |||
| |||
|
Save
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:
Save
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:
Save
Question 9 (1 point)
Let P be a singly linked list. Let Q be the pointer to an intermediate node x in the list. What is the worst-case time complexity of the best known algorithm to delete the node x from the list?
Question 9 options:
| |||
| |||
| |||
|
Save
Question 10 (1 point)
What will be the output of the following code? var a = ["1", "2"]; document.getElementById("demo").innerHTML = a;
Question 10 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