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, please leave comments if anything needs to be added or updated, discuss your queries on our facebook:qavalidation.com, Thanks!

Leave a Reply

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

%d bloggers like this: