Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

I have calculated the running time but I am not sure if I am right. Please help to check if the Big O running time

I have calculated the running time but I am not sure if I am right. Please help to check if the Big O running time complexity derived is correct. Thank you! Question 2(10.0 marks) Determine the big O running time of the method myMethod() by counting the approximate number of operations it performs. Show all details of your answer. Note: the symbol % represent a modulus operator, that is, the remainder of a number divided by another number. - static int myMethod(A[],n){ count+0 fori -0 ton -1{ for j - iton -1{ count + count+ A[] k +1 while (k < n2){ if (j%2=0){ count = count +1} k ++}} return count }}1 n n2 n 2-1 b n 2+1 n2 n 2ln 2)== n21 therefore, running time complexity: 0 in 4)

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

Rules In Database Systems Third International Workshop Rids 97 Sk Vde Sweden June 26 28 1997 Proceedings Lncs 1312

Authors: Andreas Geppert ,Mikael Berndtsson

1997th Edition

3540635165, 978-3540635161

More Books

Students also viewed these Databases questions