software






 

Question by  Smooti08 (23)

How do you sort algorithms in JAVA?

 
+5

Answer by  gigo (1706)

The easiest thing will be to search the web with algorithm names like "quick sort java" or "insert sort java". In any case you will have a stepper function and a compare function. If you have a standard int list you can take "int[] param" as function parameter. Instead of int you can take any class type as well.

 
+2

Answer by  ahlii (13)

It is assumed your list to be sorted is in object type: java.util.List and your variable name is "list". Then you can use the following code to sort: Arrays.sort(list)

 
You have 50 words left!