[SOLVED] SOLVED:CMSC350_Homework1

15.00 $

Programming resource
Digital learning resource
Category:
Practical programming resource
Suitable for guided study and reference
Tutor guidance available when needed

Description

5/5 - (1 vote)

EX 2.1 What is the order of the following growth functions? a. 10n^2 + 100n + 1000 b. 10n^3 – 7 c. 2^n + 1000n^3 d. n^2 log n
Ex 2.2 Arrange the growth functions of the previous exercise in ascending order of efficiency for n=10 and again for n=1,000,000.
EX 2.3 Write the code necessary to find the largest element in an unsorted array of integers. What is the time complexity of this algorithm?

Determine the growth function and order of the following code fragment: for (int count=0; count < n; count++) { for (int count2=0; count2 < n; count2=count2+2) { System.out.println(count, count2); } }

EX 2.5 Determine the growth function and order of the following code fragment: for (int count=0; count < n; count++) { for (int count2=0; count2 < n; count2=count2*2) { System.out.println(count, count2); } }

Resource details

Understand the Task Before You Use the Resource

Review the requirements, identify the programming concepts involved, study the implementation and test your understanding with your own examples and modifications.