Write recurrence relation corresponding to pseudo-code

Assignment Help Basic Computer Science
Reference no: EM13208691

Write a divide-and-conquer algorithm for summing an array of n in- tegers. The base case for this algorithm will be when the size of the sub-problems are smaller or equal to 4 in which case you will use an iterative loop to sum the integers of the sub-problems. You need to do the following: (a) Your program should be able to open and read a file named In- putArray that contains a single line of n integers where n is a power 2 less than 1000. (b) Your program will output on the standard output the solutions found for each pair of sub-problems as well as the level of the recursion from which the solutions are printed. The level of the initial call is 0. (c) On your solution sheet, i. Write the pseudo-code of your algorithm1 ii. Write the recurrence relation corresponding to the pseudo- code, don't forget the cost of the base case. iii. Write the solution of your recurrence, showing how you have solved the recurrence.

Reference no: EM13208691

Questions Cloud

What are the estimated cell yield coefficients based : The composition of the off-gas on a volumetric basis is listed below. What are the estimated cell yield coefficients based on ammonia and oxygen for the consumption of glucose? 4.7 PROBLEMS 115 Substrate % nitrogen % carbon dioxide % oxygen glucos..
Explain a section of membrane with an aquaporin : A section of membrane with an aquaporin (AQP) has a water transport rate of about 3 billion water molecules per second (3 × 109 molecules·s-1).
What is the initial investment outlay for the spectrometer : What is the initial investment outlay for the spectrometer, that is, what is the Year 0 project cash flow? Round your answer to the nearest cent.
Rational for wealth maximization as a goal for a firm : What is the rational for wealth maximization as a goal for a firm and what are the key financial statements and why they are important?
Write recurrence relation corresponding to pseudo-code : Write the recurrence relation corresponding to the pseudo- code, don't forget the cost of the base case. iii. Write the solution of your recurrence, showing how you have solved the recurrence.
How the quantity of british beef sold worldwide : In the late 1990's "mad cow" disease caused people to buy less beef. It also caused the European Union to ban imported British beef and the British government to ban the sale of older cattle. What is the effect of the above on price and quantity o..
Why might the increase in quantity demanded : a) Draw this demand curve, labeling the values of the y- and x-intercepts. b) Show how his demand curve and values of the y- and x-intercepts change if he obtains health insurance with no deductible and a 20% coinsurance rate.
Show what happens to the market for smartphones : two accompanying show supply an demand curves for two substitute commodities: regular cell phone and smartphones. A. Show what happens when rising raw material prices make it costlier to produce regular cell phones
Explain a section of membrane with an aquaporin : A section of membrane with an aquaporin (AQP) has a water transport rate of about 3 billion water molecules per second (3 × 109 molecules·s-1).

Reviews

Write a Review

 

Basic Computer Science Questions & Answers

  The basic solutions of the simplex method.

Solve the following problem by inspection, and justify the method of solution in terms of the basic solutions of the simplex method.

  Explaining sites appropriate for mobile devices

What do you think are some of the types of sites that would be appropriate for mobile devices? What types of sites do you think are inappropriate?

  Solve the following problems using linearity of expectation.

Solve the following problems using linearity of expectation. . (For each problem you will want to think about what the appropriate random variables should be and define them explicitly.)

  Determine minimum number of element

We wish to find the element x that is in upper half when S is sorted, or in other words element which is greater than median. Determine the minimum number of element comparision required to solve problem ?

  Four techniques for analyzing

Briefly compare and contrast the four techniques for analyzing the costs and benefits of a proposed system. What do you see as particular strengths and weakness of each method?

  What is optimal strategy if n is known

Consider the numerical 20 questions game. In this game, player 1 thinks of a number in the range 1 to n. Player 2 What is an optimal strategy if n in known?

  Create an array of integers 10 elements long

Create an array of integers 10 elements long. ? Loop through this array (using its length value), assigning a random value between 0 and 100 (inclusive) to each element. Remember: random(100) returns a float and will never return 100.0.

  What is the speedup of the system with l2 cache?

computer calculate the following: (a) What is the L2 read miss penalty? (b) What is the L1 read miss penalty? (c) What is the read penalty (L1 and L2 cache)? (d) Assume 33% (1/3) loads, and everything else is ideal. What is the CPI? (e) What would th..

  Write a problem that prompts the user for a radius

Write a problem that prompts the user for a radius and then prints: •The area and the circumference of a circle with that radius •The volume and surface area of a sphere with that radius

  Use a traditional for loop to process the array

Write a Java method which takes an integer array parameter and fills the array with random numbers between 1 and 1000, including 1 and 1000. Use a traditional for loop to process the array.

  Computing downtime in telephone per year

Telephone system has an availability of 99.999 percent. How much downtime is that per year? Express your answer in a way that is easy for someone to understand.

  Identify and describe specific capabilities of computing

Identify and describe 5 specific capabilities of computing (e.g., speed, permanence/storage) made possible or enhanced by computing technology.

Free Assignment Quote

Assured A++ Grade

Get guaranteed satisfaction & time on delivery in every assignment order you paid with us! We ensure premium quality solution document along with free turntin report!

All rights reserved! Copyrights ©2019-2020 ExpertsMind IT Educational Pvt Ltd