An algorithm that takes an array of any size

Assignment Help Computer Engineering
Reference no: EM132192968

Question :

Write an application in Java which includes an algorithm that takes an array of any size, selects the high and low integer from the array of integers with each pass and builds a new array of integers by inserting the high and low selection with each pass.

Your output should show the original array of integers and the output of each pass on a new line.

Note: You can assume all integers are positive, but your code must work for an even and odd number of integers and an array of size from 5 to 30.

Example Output:

Input Array: [ 42 , 24, 7, 13, 36, 52]

Pass 1: [7, 52]

Pass 2: [7, 13, 42, 52]

Pass 3: [7, 13, 24, 36, 42, 52]

Reference no: EM132192968

Questions Cloud

Find the longest word in an english sentence : Write an algorithm (using pseudocode) to find the longest word in an English sentence, where a sentence is a sequence of words and spaces.
Write an application that prints the integer numbers : Write an application that prints the integer numbers from 1 to 60 along-with the square root value of only even numbers.
A program to implements the sequence interface : Write algorithms and programs to create a class PrimeSequence that implements the Sequence interface.
Write an algorithm to implement a stack using two queues : Write an algorithm to implement a stack using two queues (say q1 and q2). Specifically, you need to implement the pop() and push() functions of a stack.
An algorithm that takes an array of any size : Write an application in Java which includes an algorithm that takes an array of any size, selects the high and low integer from the array of integers.
Write an application that accepts a users password : Write an application that accepts a user's password from the keyboard. When the entered password is less than six characters, more than 10 characters.
Write an algorithm to solve the independent set problem : Write an algorithm to solve the Independent set problem. In English describe the way the input is given; the output; your assumptions etc.
Find the smallest number in an array of n numbers : Find the smallest number in an array of n numbers. Determine if any number appears twice in an array of n numbers without sorting the array.
Write an application in java that models an evening stroll : Write an application in java that models an evening stroll on a street containing several buildings, some of which are haunted.

Reviews

Write a Review

Computer Engineering Questions & Answers

  Write a program that takes a single phone digit

Write a program that takes a single phone digit. If the digit is a letter, the number corresponding to the letter is returned by reference and return 0 by value indicating it is a valid digit. Here are the letters associated with each digit.

  Atm and frame relay

ATM and Frame Relay

  Write a function that decreases the green value

Write a function that decreases the green value by x% in the upper half of a picture, and increases it by y% in the lower half. Both x and y are inputs.

  Create a table with uneven cell sizes

Trying to make use of a table with uneven cell sizes. I have made the cells and 2 tables which I'm trying to combine into 1 table and then make borders around that table (and around the cells as well).

  Create a web page by using html to format text

Create a web page by using HTML to format text. Use basic elements and attributes in the creation of web pages.

  Develop various features of application software

You will also develop various features of application software that you will use in the day to day running of Better Buy Bespoke.  You will use your expertise to create macros that will automate features and functions of the application software

  Implement a method public static int indexof

Use recursion to implement a method public static int indexOf(String text, String str) that returns the starting position of the first substring of the text tha

  Are file descriptors of a parent inherited by child process

Is it allowed for a parent to terminate before one of its child processes has terminated? If so, does this affect the child processes in any way?

  Compare the two design alternatives using amdahls law

Assume that the two design alternatives are to decrease the CPI of FPSQR to 2 or to decrease the average CPI of all FP operations to 2.4.

  Find the surface temperature of the glass cover

A solar collector consists of a horizontal aluminum tube of outer diameter 5 cm enclosed in a concentric thin glass tube of 7 cm diameter.

  Discuss assessing threats to privacy in web design

the companies would share the sign-on information for any Web user who agrees to participate

  Propose how you would model the system behavior

Propose how you would model the system behavior to show suggested changes to the current process. Defend why you chose the model that you did to show the suggested changes.

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