Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

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)

image text in transcribed

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)

image text in transcribed

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)

image text in transcribed

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)

image text in transcribed

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)

image text in transcribed

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)

image text in transcribed

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)

image text in transcribed

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)

image text in transcribed

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)

image text in transcribed

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)

image text in transcribed

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

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Programming The Perl DBI Database Programming With Perl

Authors: Tim Bunce, Alligator Descartes

1st Edition

1565926994, 978-1565926998

More Books

Students also viewed these Databases questions

Question

21. Give three synonyms for variation (variability).

Answered: 1 week ago