Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

Question 7 (1 point) A ______ sort examines the data only by comparing the two e

ID: 3740754 • Letter: Q

Question

Question 7 (1 point)

A ______ sort examines the data only by comparing the two elements with a comparison operator.

Question 9 (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 < a.length; i++) {
if (a[i] == '(') {b.push('*');}
if (a[i] == ')') {if (b.length > 0) b.pop();}
}
return b.length;
}

Question 10 (1 point)

Given the following 2 functions - what is the value of calling fb(5,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 10 options:

Explanation / Answer

Q7. A Bubble sort examines the data only by comparing the two elements with a comparison

Q10. 25

Q9. 0

Hire Me For All Your Tutoring Needs
Integrity-first tutoring: clear explanations, guidance, and feedback.
Drop an Email at
drjack9650@gmail.com
Chat Now And Get Quote