Sorting array using Java

sorting_injavaFor sorting in the order of ascending or descending, we have one of the most popular sorting technique is bubble sort.

What is bubble sort – repeatedly steps through the list to be sorted, compares each pair of adjacent items and swaps them if they are in the wrong order. The pass through the list is repeated until no swaps are needed, which indicates that the list is sorted.

If string, then sorting is as follows –

 

 

Content posted is based on learning or working experience, Share the post with others if find useful, Any queries?, leave comments or discuss on our facebook:qavalidation.com, Thanks!

Leave a Reply

Your email address will not be published. Required fields are marked *

%d bloggers like this: