answersLogoWhite

0


Best Answer

If they're in an array, use java.util.Arrays.sort(). If they're in a Collection, as in java.util.Collection, use java.util.Collections.sort().

If you want an actual algorithm, try a for-each loop with an equivalence operator and conditional switch.

User Avatar

Wiki User

12y ago
This answer is:
User Avatar
More answers
User Avatar

Wiki User

13y ago

Assuming the data is preexisting and unsorted.

Sort the data.

Write the list to appropriate media.

This answer is:
User Avatar

Add your answer:

Earn +20 pts
Q: How do you write an algorithm for list of names in ascending order?
Write your answer...
Submit
Still have questions?
magnify glass
imp
Related questions

A C program using dynamic memory allocation to sort n names in ascending order?

Writing a C program that uses dynamic memory allocation to sort names in ascending order is a typical computer science assignment. To write this program, you must be in UNIX.


Write an Assembly language program which implements sorting algorithm both ascending and descending order and display those numbers with certain delay say of 5sec between successive displays?

das


How do you write polynomials in ascending and descending order?

before and after use an conpair the results


How do you write Ascending order program using 8086 microprocessor?

One many find this answer on YouTube. One also may find out how to write ascending order programs using an 8086 microprocessor by looking at the owners manual.


Write 0.1 0.01 0.9 and 0.09 in ascending order?

0.01, 0.09, 0.1, 0.9


What is algorithams?

Algarithm: Algorithm is process to solve the problem in a step by step order Algorithm is used to write the program in a computer language. thrinath.sachin@gmail.com


What is algorithm to write algorithm to the program to access a pointer variable in structure?

Here is the algorithm of the algorithm to write an algorithm to access a pointer in a variable. Algorithmically.name_of_the_structure dot name_of_the _field,eg:mystruct.pointerfield


Write an algorithm to find the root of quadratic equation?

Write an algorithm to find the root of quadratic equation


What are ascending factors?

Ascending means to write the factors from least to greatest.


A Write the algorithm to concatenate two given strings?

a write the algorithm to concatenate two given string


Sort the array of integers in Descending order?

Make use of Java's robust library: // filled with various ints int[] a; // temporary variable for swapping values int temp; // sort with fast, built-in algorithm java.util.Arrays.sort(a); // reverse the array for( int i = 0; i < a.length/2; ++i ) { temp = a[i]; a[i] = a[a.length - i - 1]; a[a.length - i - 1] = temp; } Obviously, if you're concerned with execution speed you could write your own sort method which would sort into descending order instead of ascending order (perhaps by modifying Java's sort algorithm).


How do you write an Algorithm for a C plus plus Program?

You don't write an algorithm for a C++ program, unless you are documenting the C++ program after-the-fact. The normal procedure is to write the algorithm first, in a language independent fashion, and then translate that stated algorithm into C++ code, or into whatever language you wish.