simple sorting in this how would you do itbubble sort selection sort as soon as you create significant databaseyou'll probably think of reasons to sort it in various ways you need to arrange names in alphabetical orderstudents by gradecustomers by zip codehome sales by pricecities in order of increasing populationcountries by gnpstars by magnitudeand so on sorting data may also be preliminary step to searching it as we saw in "arrays, binary searchwhich can be applied only to sorted datais much faster than linear search because sorting is so important and potentially so timeconsumingit has been the subject of extensive research in computer scienceand some very sophisticated methods have been developed in this we'll look at three of the simpler algorithmsthe bubble sortthe selection sortand the insertion sort each is demonstrated with its own workshop applet in "advanced sorting,we'll look at more sophisticated approachesshellsort and quicksort the techniques described in this while unsophisticated and comparatively sloware nevertheless worth examining besides being easier to understandthey are actually better in some circumstances than the more sophisticated algorithms the insertion sortfor exampleis preferable to quicksort for small files and for almost-sorted files in factan insertion sort is commonly used as part of quicksort implementation the example programs in this build on the array classes we developed in the preceding the sorting algorithms are implemented as methods of similar array classes insertion sort sorting objects comparing the simple sorts