Answered step by step
Verified Expert Solution
Question
1 Approved Answer
i just send this question to an expert but the answer from two expert is totally different, one is O ( nlogn ) , one
i just send this question to an expert but the answer from two expert is totally different, one is Onlogn one is On logbasen what is the correct answer? Can u please help me to write down the number of operation step by step? Like beside every lines, please help to explain also, because i am really weak at this lesson. Thanks!Determine the big O running time of the method myMethodint n by counting the approximate number of operations it performs. Show all details of your answer.
Static void doIt int n
int i
int j times n
loop while j
i n
loop while i i i
j j
Static int myMethod int n
sum
for i to n
sum sum doIti return
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started