Question: Q 1 . 1 From Code to Reccurence 1 Point Grading comment: Write the recurrence of the recursive case ( not the base case )

Q1.1 From Code to Reccurence
1 Point
Grading comment:
Write the recurrence of the recursive case (not the base case) for
mystery(n,
1)
mystery(n,1), where the initial value of the parameter
step
=
1
step =1
/*
* A mystery method
*/
public void mystery(int n, int step){
if (n <= step){
return;
}
for (int i =0; i < n; i += step){
int a = i + n /2;
System.out.print(a * a +"");
}
System.out.println();
mystery(n, step *2);
mystery(n, step *2);
}
The following multiple-choice options contain math elements, so you may need to read them in your screen reader's reading or browse mode instead of forms or focus mode.
Choice 1 of 4:
(
)
=
3
(
/
2
)
+
T(n)=3T(n/2)+n
Choice 2 of 4:
(
)
=
2
(
/
3
)
+
25
T(n)=2T(n/3)+25
Choice 3 of 4:
(
)
=
2
(
/
2
)
+
T(n)=2T(n/2)+n
Choice 4 of 4:
(
)
=
3
(
/
3
)
+
25
T(n)=3T(n/3)+25

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!