For each of the following six program fragments: a. Give an analysis of the running time (Big-Oh
Question:
a. Give an analysis of the running time (Big-Oh will do).
b. Implement the code in Java, and give the running time for several values of N.
c. Compare your analysis with the actual running times.
(1) sum = 0;
for( i = 0; i < n; i++ )
sum++;
(2) sum = 0;
for( i = 0; i < n; i++ )
for( j = 0; j < n; j++ )
sum++;
(3) sum = 0;
for( i = 0; i < n; i++ )
for( j = 0; j < n * n; j++ )
sum++;
(4) sum = 0;
for( i = 0; i < n; i++ )
for( j = 0; j < i; j++ )
sum++;
(5) sum = 0;
for( i = 0; i < n; i++ )
for( j = 0; j < i * i; j++ )
for( k = 0; k < j; k++ )
sum++;
(6) sum = 0;
for( i = 1; i < n; i++ )
for( j = 1; j < i * i; j++ )
if( j % i == 0 )
for( k = 0; k < j; k++ )
sum++;
Fantastic news! We've Found the answer you've been seeking!
Step by Step Answer:
Answer rating: 64% (14 reviews)
For all these programs the following analysis will agree with a simulatio...View the full answer
Answered By
Ashington Waweru
I am a lecturer, research writer and also a qualified financial analyst and accountant. I am qualified and articulate in many disciplines including English, Accounting, Finance, Quantitative spreadsheet analysis, Economics, and Statistics. I am an expert with sixteen years of experience in online industry-related work. I have a master's in business administration and a bachelor’s degree in education, accounting, and economics options.
I am a writer and proofreading expert with sixteen years of experience in online writing, proofreading, and text editing. I have vast knowledge and experience in writing techniques and styles such as APA, ASA, MLA, Chicago, Turabian, IEEE, and many others.
I am also an online blogger and research writer with sixteen years of writing and proofreading articles and reports. I have written many scripts and articles for blogs, and I also specialize in search engine
I have sixteen years of experience in Excel data entry, Excel data analysis, R-studio quantitative analysis, SPSS quantitative analysis, research writing, and proofreading articles and reports. I will deliver the highest quality online and offline Excel, R, SPSS, and other spreadsheet solutions within your operational deadlines. I have also compiled many original Excel quantitative and text spreadsheets which solve client’s problems in my research writing career.
I have extensive enterprise resource planning accounting, financial modeling, financial reporting, and company analysis: customer relationship management, enterprise resource planning, financial accounting projects, and corporate finance.
I am articulate in psychology, engineering, nursing, counseling, project management, accounting, finance, quantitative spreadsheet analysis, statistical and economic analysis, among many other industry fields and academic disciplines. I work to solve problems and provide accurate and credible solutions and research reports in all industries in the global economy.
I have taught and conducted masters and Ph.D. thesis research for specialists in Quantitative finance, Financial Accounting, Actuarial science, Macroeconomics, Microeconomics, Risk Management, Managerial Economics, Engineering Economics, Financial economics, Taxation and many other disciplines including water engineering, psychology, e-commerce, mechanical engineering, leadership and many others.
I have developed many courses on online websites like Teachable and Thinkific. I also developed an accounting reporting automation software project for Utafiti sacco located at ILRI Uthiru Kenya when I was working there in year 2001.
I am a mature, self-motivated worker who delivers high-quality, on-time reports which solve client’s problems accurately.
I have written many academic and professional industry research papers and tutored many clients from college to university undergraduate, master's and Ph.D. students, and corporate professionals. I anticipate your hiring me.
I know I will deliver the highest quality work you will find anywhere to award me your project work. Please note that I am looking for a long-term work relationship with you. I look forward to you delivering the best service to you.
3.00+
2+ Reviews
10+ Question Solved
Related Book For
Data Structures and Algorithm Analysis in Java
ISBN: 978-0132576277
3rd edition
Authors: Mark A. Weiss
Question Posted:
Students also viewed these Computer Sciences questions
-
For each of the following SQL queries, for each relation involved, list the attributes that must be examined to compute the answer. All queries refer to the following relations: Emp(eid: integer,...
-
For each of the following SQL queries, for each relation involved, list the attributes that must be examined to compute the answer. All queries refer to the following relations: Emp(eid: integer,...
-
For each of the following system calls, give a condition that causes it to fail: fork, exec, and unlink.
-
QUESTION ONE Matrix X sells computer hardware and software components as well as other ancillary items to customers all over South Africa. Matrix X also provides installation of hardware and software...
-
A projectile, initially at the origin, moves along a straight-line path through a fluid medium such that its velocity is v = 1800 (1 - e -03e) mm/s, where t is in seconds. Determine the displacement...
-
The following are steps in the methodology for designing tests of controls, substantive tests of transactions, and tests of details of balances for the payroll and personnel cycle: 1. Design tests of...
-
The landing speed of a winged aircraft such as the Space Shuttle is dependent on the air density. By what percent must the landing speed be increased on a day when the temperature is \(110^{\circ}...
-
Zimmerman Clothiers manufactures womens business suits. The company uses a standard cost accounting system. In March 2014, 15,700 suits were made. The following standard and actual cost data applied...
-
Discuss how the Eastern market will potentially view new hire orientation, and then discuss two to three ways to tailor the new hire orientation to this market?
-
X Ltd. has 10 lakhs equity shares outstanding at the beginning of the accounting year 2016. The appropriate P/E ratio for the industry in which D Ltd. is 8.35. The earnings per share is Rs. 15 in the...
-
Explain how an understanding of consumers learning processes might affect marketing strategy planning. Give an example.
-
Suppose you need to generate a random permutation of the first N integers. For example, {4, 3, 1, 5, 2} and {3, 1, 4, 2, 5} are legal permutations, but {5, 4, 1, 2, 1} is not, because one number (1)...
-
List any five inception artifacts.
-
The goal of this item is to show that if u = (u, u) and lel to each other if and only if uv2 u2v = 0. = (v1, v2) are vectors in R2, then, u and 7 are paral- (a) Begin by stating the definition of u...
-
Find and use annual reports for Yum brands along with any other sources you believe would be reputable and relevant to this project. It should be based on your analysis of the companys financial...
-
Suppose individuals get utility from consumption and disutility from working according to the following utility function: (c) = -1 where c and I denote consumption and hours of work, respectively,...
-
KNO 2 potassium nitrite is a salt that is very soluble in water. Its dissolution forms the species K + and NO 2- . Potassium sulphate (K2SO4) is a salt that is very soluble in water. dissolution...
-
For the charges shown, the magnitude of the electric force on point charge q2 due to point charge q has a magnitude of F1 on 2 = 800 N. To the figure, add charges 93, 94, 95 and qe such that the...
-
Write an equation for each parabola with vertex at the origin. Focus (-1/2, 0)
-
Reread the discussion leading to the result given in (7). Does the matrix sI - A always have an inverse? Discuss.
-
A group of 2n - 1 router is interconnected in a centralized binary tree, with a router at each tree node. Router i communicate with router j by sending a message to the root of the tree. The root...
-
A disadvantage of a broadcast subnet is the capacity wasted when multiple hosts attempt to access the channel at the same time. As a simplistic example, suppose that time is divided into discrete...
-
What are two reasons for using layered protocols?
-
1. There are missing parts in the program below and fix the bugs: isJavaFun = true; = is Fish Tasty false; System.out.println("Is Java Fun' is JavaFun); System.out.println("Is Fish TASTY" isFish...
-
Write regular expressions in Java for the following: Strings between10and20characters (inclusive) which have odd lengths. The allowed characters here are not specified, and should be considered...
-
These containers are available in four sizes: huge, large, medium, and small, which can hold 50, 20, 5 and 1 widgets, respectively. The cost of each of the containers, at this time, is $35.00 (huge),...
Study smarter with the SolutionInn App