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)

Question 1 (1 point) Given the following 2 functions - what is

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)

the value of calling fb(4,2)? function fa(x, y){ if (y == 0)

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)

return 0; return (x + fa(x, y-1)); } function fb(x, y) {

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:

1)

1 1 0 0 1

2)

1 0 0 1 1

3)

1 1 1 0 1

4)

1 0 1 1 1

5)

1 0 0 0 1

6)

1 1 1 1 1

7)

1 1 0 1 1

Save

Question 4 (1 point)

if (y == 0) return 1; return fa(x, fb(x, y-1)); } Question

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)

1 options: Save Question 2 (1 point) What is the value of

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)

f5(3,4,5) for the following function; function f5(n, a, b){ if (n Question

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:

1)

1 1 0 0 1

2)

1 0 0 1 1

3)

1 1 1 0 1

4)

1 0 1 1 1

5)

1 0 0 0 1

6)

1 1 1 1 1

Save

Question 7 (1 point)

2 options: Save Question 3 (1 point) What is the return value

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)

of f2(17) ? function f2(n) { if (n == 0) return "";

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)

return n % 2 + " " + f2(parseInt(n/2)); } Question 3

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:

1)

O(n)

2)

O(logn)

3)

O(n logn)

4)

O(1)

Save

Question 10 (1 point)

options: 1) 1 1 0 0 1 2) 1 0 0 1

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

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!