Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Asymtotic Notation a. Consider the following Code-segment: for(i=1; i < N * N * N;i+++) for(j=0; j < N * N;j+++) x+= 1; What can

Asymtotic Notation

a. Consider the following Code-segment:

for(i=1; i < N * N * N;i+++)

for(j=0; j< N * N;j+++)

x+= 1;

What can you say about the running time for this code segment in terms of Big-Oh? be sure to justify your asnwer.

Please explain in detail.

b.Count the operations for the following code sgment and then determine the big-oh in terms of the input size N.

line 1 sum = 0;

line 2 for(i = 0; i * i < N;i++)

line 3 for(j = 0;j * j < N;j++)

line 4 sum++;

line 5 for(k = 0; k < N; k++)

line 6 sum++;

please explain in detail.

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

Database Systems Introduction To Databases And Data Warehouses

Authors: Nenad Jukic, Susan Vrbsky, Svetlozar Nestorov

1st Edition

1943153191, 978-1943153190

More Books

Students also viewed these Databases questions

Question

How do Excel Pivot Tables handle data from non OLAP databases?

Answered: 1 week ago