How to apply sorting arrays in Java?

Hello, users of the Toaster!
I had the problem when learning Java, I read books on it, it was all clear, even in practice, something could do, but 2 days ago, stumbled on the topic of sorting arrays. Read, searched in books, but I can understand no examples.
What could me anyone
- how to combine nested loops with sorting?
- how to add sorting itself? (say, using fast or Array.sort())
I would be very grateful for the detailed answer, thank you very much for your attention!
July 2nd 19 at 17:46
4 answers
July 2nd 19 at 17:48
What could me anyone
- how to combine nested loops with sorting?
- how to add sorting itself?

- Nested loops will combine when there is understanding of what the cycle if I decided to write attachment on every outer loop will be executed inside a number of times which will ask, then how to end run the inner loop, start the second outer loop, and so long as the external will not end (the main loop) which will start the internal. (I hope answered the question because it is not quite clear). Combine them with this in needs that much time to sort what the cycle stuff (external or internal)..

- Add sort think it will be when the understanding of the cycles and what each does
If you need speed then look for examples of fast sorting algorithms, Ishida pretty quickly in Google.
July 2nd 19 at 17:50
If you want to understand the sorts, then you need to Google "sorting algorithms", there will be case studies on different JAP.

java.util.Arrays.sort(primitive types) - implements the quicksort algorithm;

java.util.Arrays.sort(objects) - sorting algorithm merge;

To make a more efficient implementation you are unlikely to come...
For the particular case of quite - charity84 commented on July 2nd 19 at 17:53
July 2nd 19 at 17:52
If you are interested in sorting collections, you can use the method Collections.sort (Collection, Comparator).

The more detail you can read here.
July 2nd 19 at 17:54
All sorting algorithms used in only two operations: comparison and exchange of elements (swap). Nested loops just used to compare each array element with titlename (e.g. bubble sort).
I understand that, but don't know how to put into practice, for example, to make a nested loop that will satisfy the conditions of this situation - charity84 commented on July 2nd 19 at 17:57
Well, if you know, you first make a sequence on my fingers (on paper), then write the corresponding algorithm. Nothing complicated there: two loops, one inside the other, and Blaise conditional statements. - sheridan.Bergnaum commented on July 2nd 19 at 18:00

Find more questions by tags AlgorithmsArraysJava