Terminé

sorting names

The program has to sort a list of names in alphabetical order, and print them on the screen. We will use the array of String references that will be passed as the argument to the main method for the data input. This array(usually called args)represents all the words that follow the class name on the command line. Ex: if the command > java Sort bill tom sue anna jerry paul zoe is entered, the first array element will refer to the String object"bill", the second to "tom", and so on. In order to sort the list of names alphabetically, we will enter every name into a single linked list, thereby observing the location where it should be entered to maintain the list [url removed, login to view] can be done as follows:we use a reference variable"pointer" (or"index")to traverse the singled linked list upto the element which comes directly before the element that we want to insert in the alphabetical [url removed, login to view] will then add the new element right behind this. Note: In a single linked list, the element"behind" is the one that the reference"next" refers to. Since we have only a reference to the next element, we don't know which element is in front. The new element becomes this element that the reference"next" refers to. But there might be already a next element. We have to make sure not to loose that: we first secure the remainder of the list by assigning the reference to a local variable, which we define for this purpose. Then we can add the new element into the list by replacing the value of next with the reference to the new element. Last, the "next" reference of the new element becomes the reference to the remained of the list, which was saved temporarily in a local variable. The first element is "bill". Then "tom" will be added after "bill", and "sue" goes between "bill" and "tom". Now, we have a problem to add "anna" since we can only insert new elements after after an element in the list. There is a trick to take care of that: instead of starting with an empty list, we create a first element which has the value " "(space character). Every name that will be inserted into the list will definitely be after this element. Everything works fine. After all names are included, the program can just print the list. The names will appear in alphabetical order. Note: we can skip the first (empty) element in the printout.

## Deliverables

The class String offers a method"compareTo" which returns 1 if the contents fo the string is lexicographically greater than the argument, -1 of it is less, and 0 if the contents of both Strings is the same. class String { public int compareTo(String x) {.... .... This program can be written as one Java class. We only need a main method. To print the list on the screen, we can use the method "[url removed, login to view](....)". Cannot do a similar program for someone, no less than two months. If you do a similar program after two months it has to be some major differences from the one you do for me. 1) Complete and fully-functional working program(s) in executable form as well as complete source code of all work done. 2) Installation package that will install the software (in ready-to-run condition) on the platform(s) specified in this bid request. 3) Complete ownership and distribution copyrights to all work purchased.

## Platform

windows

## Deadline information

delivery at least an hour before midnight eastern time on 01/20/2003

Compétences : Ingénierie, Java, MySQL, PHP, Architecture Logicielle, Tests de Logiciels

en voir plus : two string problem, the string problem, string source code java, sorting of data, sorting method, sorting array of strings in c, sort array list in java, sort array c, purpose of sorting, print println java, paul words, linked int, everything sorted, t paul, anna s, zoe, sue, jerry, java complete reference, program linked list

Concernant l'employeur :
( 4 commentaires ) United States

Nº du projet : #2899435

Décerné à:

oleg21

See private message.

%selectedBids___i_sum_sub_7% %project_currencyDetails_sign_sub_8% USD en 14 jours
(137 Commentaires)
7.0

27 freelance font une offre moyenne de $19 pour ce travail

herculesevw

See private message.

%bids___i_sum_sub_35% %project_currencyDetails_sign_sub_36% USD en 14 jours
(79 Commentaires)
4.7
fusion35

See private message.

%bids___i_sum_sub_35% %project_currencyDetails_sign_sub_36% USD en 14 jours
(19 Commentaires)
4.4
basitj

See private message.

%bids___i_sum_sub_35% %project_currencyDetails_sign_sub_36% USD en 14 jours
(13 Commentaires)
3.8
vw450309vw

See private message.

%bids___i_sum_sub_35% %project_currencyDetails_sign_sub_36% USD en 14 jours
(17 Commentaires)
3.8
ioikmn

See private message.

%bids___i_sum_sub_35% %project_currencyDetails_sign_sub_36% USD en 14 jours
(14 Commentaires)
3.7
davem2

See private message.

%bids___i_sum_sub_35% %project_currencyDetails_sign_sub_36% USD en 14 jours
(29 Commentaires)
3.7
jameswalt

See private message.

%bids___i_sum_sub_35% %project_currencyDetails_sign_sub_36% USD en 14 jours
(15 Commentaires)
3.8
vw627017vw

See private message.

%bids___i_sum_sub_35% %project_currencyDetails_sign_sub_36% USD en 14 jours
(24 Commentaires)
3.5
patrica

See private message.

%bids___i_sum_sub_35% %project_currencyDetails_sign_sub_36% USD en 14 jours
(19 Commentaires)
3.2
vudusoftvw

See private message.

%bids___i_sum_sub_35% %project_currencyDetails_sign_sub_36% USD en 14 jours
(5 Commentaires)
2.9
lonapz

See private message.

%bids___i_sum_sub_35% %project_currencyDetails_sign_sub_36% USD en 14 jours
(10 Commentaires)
2.8
navenduvw

See private message.

%bids___i_sum_sub_35% %project_currencyDetails_sign_sub_36% USD en 14 jours
(24 Commentaires)
2.8
vw547142vw

See private message.

%bids___i_sum_sub_35% %project_currencyDetails_sign_sub_36% USD en 14 jours
(18 Commentaires)
2.4
nickyro

See private message.

%bids___i_sum_sub_35% %project_currencyDetails_sign_sub_36% USD en 14 jours
(8 Commentaires)
2.3
linusvw

See private message.

%bids___i_sum_sub_35% %project_currencyDetails_sign_sub_36% USD en 14 jours
(5 Commentaires)
2.0
junipervw

See private message.

%bids___i_sum_sub_35% %project_currencyDetails_sign_sub_36% USD en 14 jours
(6 Commentaires)
1.2
keedonou

See private message.

%bids___i_sum_sub_35% %project_currencyDetails_sign_sub_36% USD en 14 jours
(4 Commentaires)
1.1
cnotevw

See private message.

%bids___i_sum_sub_35% %project_currencyDetails_sign_sub_36% USD en 14 jours
(3 Commentaires)
0.9
navdalm

See private message.

%bids___i_sum_sub_35% %project_currencyDetails_sign_sub_36% USD en 14 jours
(1 Évaluation)
0.7
l0g1x

See private message.

%bids___i_sum_sub_35% %project_currencyDetails_sign_sub_36% USD en 14 jours
(2 Commentaires)
0.0