Design an algorithm that creates the table c

Assignment Help JAVA Programming
Reference no: EM13940555

Consider a table B that consists of m integers B [1], B [2] ... B [m]. Design an algorithm to produce a two-dimensional m x m table C such that each element C[i,j] for i <j contains the sum of the B [i] up to the B [j], that is, (B [i] + B [i +1] + ... + B [j]). The values C[i,j] for i >= j are left unspecified, that is, these can take any value.

a) Design an algorithm that creates the table C according to the above description and has time complexity Theta(m^3).
In response give either pseudocode or the description of the steps of the algorithm, and calculate the time complexity.

b) Design an algorithm that creates the table C according to the above description and has time complexity Theta(m^2).
In response give either pseudocode or the description of the steps of the algorithm, and justify the time complexity.

Reference no: EM13940555

Questions Cloud

Analyze and describe the concept of jury nullification : In 1984, the Supreme Court ruled that in order to establish ineffectiveness of counsel, a defendant must prove that two constitutional standards were violated. Discuss what these two standards are and how they establish ineffectiveness of counsel.
Designing an effective electrical safety program : Several regulations and standards must be considered when designing an effective electrical safety program. OSHA has a series of regulations under Subpart S dealing with electrical systems
Translate strategic goals and objectives : 'If effective operations management is to  translate strategic goals and objectives into action, whist ensuring continuity of supply of products and services to customers, then it is imperative that the key characteristics of strategies employed  ..
What is the present value of the cash flow : If the appropriate interest rate is 8 percent, what is the present value of the cash flow stream that the company is offering you? (Round answer to the nearest whole dollar, e.g. 5,275.)
Design an algorithm that creates the table c : Design an algorithm that creates the table C according to the above description and has time complexity Theta(m^2).In response give either pseudocode or the description of the steps of the algorithm, and justify the time complexity.
Government inquiry into taxation minimisation : What recommendations would you make to a government inquiry into taxation minimisation by companies?
Data are available for one of the products : data are available for one of the products sold by Green Company, which uses a perpetual inventory system
The demand for dvd players is expanding rapidly : The demand for DVD players is expanding rapidly, but the industry is highly competitive. A plant to make DVD players costs $40 million, has an annual capacity of 100,000 units, and has an indefinite physical life. The variable production cost per uni..
Strategic management process : Assignment brief: Prepare a strategic report that includes an introduction, summary and list of academic references which comply with Harvard, to support the requests in the case study covering the following areas: 1. Provide a critical insight in..

Reviews

Write a Review

JAVA Programming Questions & Answers

  Using a sentinel value to control a while loop

On this exercise I need to write a while loop that uses a sentinel value to control a loop in a Java program.  I also need to write the statements that make up the body of the loop.  I have already entered the necessary variable declarations and o..

  What must a subclass do to modify a private superclass

When a class extends an abstract class, it must provide definition of all the methods that are declared in the abstract class. Otherwise, it gives a compile time error.

  Prepare a java program draws a chess board

Write a Java program "chess.java" that draws a chess board with 8 x 8 squares, half of the squares are filled black and are interleaved with the white squares.

  Create a gui with a text field and a button

The java program needs to create a GUI with a text field and a button, with an actionlistener. When the button is clicked, whatever text typed into the text field is stored in a variable and written to a text file

  This assignment will focus on creating java servlets that

this assignment will focus on creating java servlets that can not only serve html to web users but also provide a web

  Extend the java defined hashmap class

Your goal is to extend the java defined HashMap class to add the ability to store multiple objects. To do this, you will edit MultiHashMap.java to both add new methods and override two methods from HashMap.

  Write a java applet for grade of gas in costco gas station

Write a java applet (not a java application program) for costco gas station. The applet will first ask you whether you are a costco customer, then the grade of gas you want to use.

  Design a java program that simulates a slot machine

Design a java program that simulates a slot machine. When the program runs, it should do the following: Ask the user to enter the amount of money he or she wants to insert into the slot machine. ? Instead of displaying images, the program will random..

  Write a thread function to initialize 2d array

write a thread function to initialize int 2D array x (NxN) so that each thread initializes its portion with i+j in each slot. Note that i and j relate to the entire array.

  Create a panel with borderlayout

Create a panel with BorderLayout. Add a button labeled "OK" to the south side of the panel - given the program, show the values of the array

  Prepare an overloaded constructor

Prepare an overloaded constructor that provides values for each field. Also provide get methods for each field. Save the file as Patient.java.

  Write a program which adds two matrices

Write a program which adds two matrices together and displays the sum - Two arrays will contain user input, and the third array will be used to contain the sum of the two arrays.

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