Question: SOLVE IN JAVA DATA STRUC EXPERTS ONLY PLZ Q 3 ) Consider the following nested loop: ) = 1 ; i ( n ; i

SOLVE IN JAVA DATA STRUC EXPERTS ONLY PLZ
Q3) Consider the following nested loop:
)=1;i(n;i++)(n
(a) How many times is "j=j+10" executed? (Do not ignore multiplicative constants, as we
are not talking about the O-notation yet).
(b) In the code shown above, answer (a), if we replace "j=j+10", with "j=j**4".
(c) Answer (a), if we make the following two changes to the code: We replace "i++" with
"?i=2", as well as we replace j=j+10'' with j=j***4''.
Do not ignore multiplicative constants for this question. So, if some piece of code executes
roughly n6 times, then you should say it executes n6 times rather than O(n) time. However, you
don't have to write additive constants: I wouldn't care the difference between n2n6+1 etc.
Secondly, do not ignore the base of the log. So if a piece of code runs 5nlog3n? you should
not write it like: 5nlog=??
So,(a) Don't ignore multiplicative constants, and (b) Don't ignore the base of the logs
SOLVE IN JAVA DATA STRUC EXPERTS ONLY PLZ Q 3 )

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 Programming Questions!