Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

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

image text in transcribed
image text in transcribed
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): 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<>

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

More Books

Students also viewed these Databases questions

Question

4. What are the current trends in computer software platforms?

Answered: 1 week ago