Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Hi, I need assitance with my assignment, understanding Big-Oh analysis , please give me the step by step breakdown for these 2 questions. // Fragment

Hi, I need assitance with my assignment, understanding Big-Oh analysis, please give me the step by step breakdown for these 2 questions.

// Fragment 7

for( int i = 0; i < n; i++ )

for( int j = 0; j < n * n; j++ )

for( int k = 0; k < j; k++ )

sum++;

// Fragment 8

for ( int i = 1; i < n*n; i *= 3 )

for ( int j = 0; j < n; j++ )

for ( int k = 1; k < i; k += 2 )

sum++; [for loop nest ends]

for ( int i = 0; i < n*n; i++ )

if ( i % 4 == 0 )

for ( int j = 1; j < i; j++ )

sum++;

Thank you.

This format doesnt allow me to show you that the for loops are nested, so for fragment 7 they are and for fragment 8 i specified when the nested loop ends. thank you.

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

Concepts of Database Management

Authors: Philip J. Pratt, Mary Z. Last

8th edition

1285427106, 978-1285427102

More Books

Students also viewed these Databases questions

Question

How do Dimensional Database Models differ from Relational Models?

Answered: 1 week ago

Question

What type of processing do Relational Databases support?

Answered: 1 week ago

Question

Describe several aggregation operators.

Answered: 1 week ago