Reverse the array, and find the largest element

Assignment Help JAVA Programming
Reference no: EM13162990

 find the max block of an array by splitting it into three parts: left, middle, right. And then reverse the array, and find the largest element.

 

public static int maxBlock(int data[], int n) {

// Divide and conquer
public static void out1(int data[], int n) {

// 1 element on the left, the rest of the array on the right
public static void out2(int data[], int n) {

// All but 1 element on the left and the remaining element on the right
public static void out3(int data[], int n) {

// Swap the first and last elements, reverse the remaining array
public static void reverse(int data[], int n) {

// Return the index of the largest element in the array. Divide and conquer
// with a left half, a middle element, and a right half. The largest element
// of an empty array does not make sense so you should never call the
// recursive method on an empty array.

public static int largest(int data[], int n) {

Reference no: EM13162990

Questions Cloud

What is the specific heat for the metal : It takes 47.0 J to raise the temperature of an 9.00 g piece of unknown metal from 13.0rm ^circ C to 25.0^circ{C}. What is the specific heat for the metal?
Calculate the mass of propylene glycol : Calculate the mass of propylene glycol ({rm{C}}_3 {rm{H}}_8 {rm{O}}_2 ) that must be added to 0.340 kg of water to reduce the vapor pressure by 2.86 torr at 40 ^circ ,{rm C} (P_{{rm H}_2{rm O}} at 40 ^circ,{rm C} = 55.3;{rm torr}).
What volume will the helium occupy at standard : A cylinder of helium has a volume of 8.00 L. The pressure of the gas is 388 lb in-2 at 25C. What volume will the helium occupy at standard atmospheric pressure (14.7 lb in-2) assuming there is no temperature change?
What is the equilibrium partial pressure of so3 : at 900K the following reaction has kp=.345: 2SO2(g)+O2(g)-->2SO3(g) Partial pressures of SO2 is .150 and of O2 is .455. What is the equilibrium partial pressure of SO3?
Reverse the array, and find the largest element : find the max block of an array by splitting it into three parts: left, middle, right. And then reverse the array, and find the largest element.
What mass of methanol is likely to be produced : methanol, CH3OH can be produced through the reaction of CO and H2. if 75.o grams of CO is used and the typical yield is 79.8%, what mass of methanol is likely to be produced.
Describe why magnetic metals are found : Explain why magnetic metals are found only among the 3d and 4f elements. Why are Sc and Ti, which are also 3d elements, diamagnetic?
Write a complete java program assuming that the variables gp : Write a complete java program Assuming that the variables gpa, deanList and studentName have been declared, you should read in the studentName and gpa from keyboard. Write an if statement that adds 1 to deansList and prints studentName to the standar..
Compute the new temperature of the gas : A sample of CO2 gas at 795 torr is cooled from 25°C until the new pressure is 125 torr. Calculate the new temperature of the gas.

Reviews

Write a Review

JAVA Programming Questions & Answers

  Determine the day of the week for new year''s day

This assignment contains a java project. Project evaluates the day of the week for New Year's Day.

  Simulate some people catching fish in a lake in java program

In this project, you will simulate some people catching fish in a lake. The purpose of the assignment is to get used to using Arrays as well as getting more experience in having objects interact together.

  Java program simulate a network

Java program simulate a network

  Java application which creates bank records

Write down a java application which creates 10000 bank records and the allow user ti enter a balance and customer account info. using a an account number.

  Method named isallvowels that returns

Write a method named isAllVowels that returns whether a String consists entirely of vowels (a, e, i, o, or u, case-insensitively). If every character of the String is a vowel, your method should return true. If any character of the String is a non-vo..

  Create system in java using agile approach

You are a software manager in company which designs critical control software for aircraft. Create system in Java using agile approach with a user involved in the development team.

  Create a circle class

create acircle class, which has one field, the radius. the class should contains two constructors: a no-argument constructor that set the radius to zero, and a constructor that takes a parameter to set the radius.

  Implement a shopping cart class with user interface

project will be to implement a shopping cart class with user interface (UI) that contains main() in Net Beans. The UI class will be used to perform user input/output and to invoke the appropriate methods of shopping cart class. When your program star..

  Determine the decision of java

Determine the decision of Java as the platform to develop this program. Identify the Java-based technologies utilized in this project and analyze each of them. Then, provide discussion on the purpose of each of the Java-based technologies utiliz..

  Implement a shopping cart class with user interface

project will be to implement a shopping cart class with user interface (UI) that contains main() in Net Beans. The UI class will be used to perform user input/output and to invoke the appropriate methods of shopping cart class. When your program star..

  Develop view for order number and order total in file

Develop a view named OrdTot. It comprises of order number and order total for each order currently on file. Order total is the sum of number ordered.

  Instance methods

instance methods: setWidth(double w), setHeight(double h), double getWidth(), double getHeight() and double getArea() * A triangle's area is calculated by width*height*0.5  * all variables are private and methods public.

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