Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Q2 : Express the following functions in terms of Big-O notation (a, b and c are constants) 1. f(n)=n33n 2. f(n)=1+4n 3. f(n)=7n+10n+3 4. f(n)=2n+10n+3

image text in transcribed
image text in transcribed
Q2 : Express the following functions in terms of Big-O notation (a, b and c are constants) 1. f(n)=n33n 2. f(n)=1+4n 3. f(n)=7n+10n+3 4. f(n)=2n+10n+3 5. f(n)=an2+bn+c 6. f(n)=2n+nlogn+c 7. f(n)=nlogn+blogn+c Q1: Count Primitive Operations of the following algorithms : \# operations Line 1 Algorithm ArrayMax(A,n) Line2 currentMax A[0] Line3 for i1;i currentMax then Line5 currentMax A [i] Line6 endif Line7 endfor Line 8 return currentMax Total: F(n)= Big(o): \# operations Line 1 int a ,countEven, countOdd Line2 if a%2==0 Line3 countEven++; Line4 else Line5 countodd++; Line6 endif Total: F(n)= Big(o)<>

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_2

Step: 3

blur-text-image_3

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

Database And Expert Systems Applications 23rd International Conference Dexa 2012 Vienna Austria September 2012 Proceedings Part 1 Lncs 7446

Authors: Stephen W. Liddle ,Klaus-Dieter Schewe ,A Min Tjoa ,Xiaofang Zhou

2012th Edition

3642325998, 978-3642325991

More Books

Students also viewed these Databases questions