Design and implement a sorting algorithm

Assignment Help JAVA Programming
Reference no: EM1380172

Your task is to design and implement a sorting algorithm

Algorithm that can sort nonnegative integers that fall within some limit, L

You will have a large array of numbers, of size N
e.g. N=10,000, L=20:
you have 10,000 numbers to sort, but the numbers are only from 0...20 range

You should design an algorithm that works in 0(N+L) time, that is, running time grows as a linear function of the array size, as long as L is not changed

It may be helpful to use one of the Majority Algorithms for inspiration in your thinking about the algorithm

Take integers from standard input (System.in):

Line 1 - single integer specifying number N<=100000 of elements in array 10
Line 2 - single integer specifying the number 1 L<=100, limit on the value of the integers to 7 be sorted 10
Lines 3 to N+2 - integers to be sorted, each 7 in range 0 to L 1

output sorted array to standard output (System.out), with each integer on a separate line

 

Reference no: EM1380172

Questions Cloud

Java program to make choice for a coffee cup size : Create an application that prompts the user to make a choice for a Coffee cup size, S for Small, T for Tall, G for Grande and V for Venti the rates of cup sizes will be stored in a parallel double array as $2, $2.50, $3.25, and $4.50 respectively.
Preparing a java program : Prepare a program that asks the user how many automobiles are to be explained, and for each automobile it inputs the user's selection of make and color.
Creating villian : Announce a new Villian called sharpay who has a wit of 24, a stealth of sixteen, and who has currently claimed three victims: Chad, Troy, and Gabriella.
Creating a class for services : Make a class for services offered by a hair styling salon. Information fields with a String to hold the service description, a double to hold the price, and an integer to hold average number of minutes it takes to perform the service.
Design and implement a sorting algorithm : Your task is to design and implement a sorting algorithm and running time grows as a linear function of the array
Important java questions : Add a method addText to the Question class, and provide a different implementation of Choice Question that calls add Text rather than storing an array list of selections.
Benefits of dynamic over static arrays : Discuss the benefits of dynamic over-static arrays. Under what conditions will you choose dynamic arrays?
Creating class diagram : Think about a computer system used to manage loans for a library. Libraries loan books, CDs, videos and magazines to registered members.
Creating flowchart to compute and print the total sale : A coorporation's salesman are selling toothpaste and tooth powder. The corporation having fifty salesman gives 10% commission on the sale of toothpaste and 20 percent commission on tooth powder.

Reviews

Write a Review

JAVA Programming Questions & Answers

  Insert uml design diagrams, use case, classes

Insert UML design diagrams here (use case, class, and sequence diagram).

  Develop java code to compute monthly rent for housing units

Develop a java code that computes monthly rent for 3 housing units namely Bungalows,Apartments and hostels. All housing units have got size,color and monthly rental rate.

  Java enumeration lettergrade represent letter grades

Write a java enumeration LetterGrade that represents letter grades A through F, including plus and minus grades. Define a private instance variable holding a boolean value.

  Write a java windowed application

Write a Java windowed application to do online quiz on general knowledge and the application also displays the quiz result.

  Represent one book in java

Represent one book in java

  Fixing errors in a java program

You coded the following on line ten of the class MyApplet.java:

  Communication with an smtp server

Develop a graphical user interface based java program that can communicate with a real SMTP email server for sending emails

  Create a java program to calculate the circumference

Create a Java program based on the geometric shapes. The program should begin by prompting you for the shape you want to calculate the circumference.

  Write complete java program to read from keyboard

Write complete Java program to read, from keyboard, a student's first and last name and six grades. It will display on screen last name then first letter of first name with a period.

  Mean and standard deviation using using eclipse

Java programming to calculate Mean and standard deviation using Using Eclipse.

  Compute area and perimeter of a polygon

Create a project that would let a user compute area and perimeter of a polygon

  Web engineering principles

web application development, Web Engineering methodology, UML-based Web Engineering (UWE), models to the expansion of web applications, Object Oriented Web Solutions (OOWS),Web Modeling Language (WebML) methodology, Object-Oriented Hypermedia Design..

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