answersLogoWhite

0

What is the Java program for sorting an array?

Updated: 8/17/2019
User Avatar

Wiki User

12y ago

Best Answer

Java has a very efficient built in implementation of quick sort. You can use it on any array of primitives or Comparable Objects by invoking Arrays.sort(<array>)

See related link.

User Avatar

Wiki User

12y ago
This answer is:
User Avatar

Add your answer:

Earn +20 pts
Q: What is the Java program for sorting an array?
Write your answer...
Submit
Still have questions?
magnify glass
imp
Related questions

Sorting an array of numbers in java?

here you will a good example on java sorting algorithm application http://javacodespot.blogspot.com/2010/08/java-sorting-animations.html http://javacodespot.blogspot.com/


Sorting of array through function in java programming?

// the build in sorting functions in Java will sort pretty much any array // of Comparable objects or primitives Arrays.sort(someArray);


8086 assembly program to sort a list of integers?

assembly language program for sorting an array using 8086 microprocessor.


What are benefits of array in java?

array example in java


Why might one need a sting array object in Java?

One might need a sting array object in Java to use protective measures on one's computer to prevent one's program from writing outside the bounds of the array.


Write a program sort a list of names in alphabetical order in java programming language?

// Let's assume we're sorting the characters in String toSort // convert the String to an array of characters char[] chars = toSort.toCharArray(); // let Java do the sorting for you Arrays.sort(chars); // recreate the original String with the newly sorted array of characters toSort = new String(chars);


What is the different sorting algorithms for arrays in java?

The built in array sorting algorithm (java.util.Arrays.sort) depends on the type of data being sorted. Primitive types are sorted with a modified implementation of quicksort. Objects are sorted with a modified implementation of mergesort.


Program to print sorting of an array in clanguage?

/* PROGRAM TO SORT ARRAY ELEMENTS USING BUBBLE SORT*/ #include #include void main() { int i,j,n,t,a[50]; clrscr(); printf("ENTER THE ARRAY SIZE:\n"); scanf("%d",&amp;n); printf("ENTER THE ARRAY ELEMENTS:\n"); for(i=0;i


Where can someone download Java for free?

Java is a free program which can be downloaded from the official site. The official site hosts an array of java related programs ranging from SDK's to just the runtime enviroment.


Sorting an array in PHP without using sort function?

plz as soon as possible give me the program for shorting an array in asscending order without using any sort function in c++


What are the Application of quick sort?

Sorting an array.


Write a java program to find sum of even and odd numbers in given array?

for(int i = 1; i &lt; 100; i+=2) { System.out.println(i); }