Sorts are used every day in many applications Discuss when y
Sorts are used every day in many applications.
Discuss when you would use a sort and what kind of sort you would use for a given situation.
Solution
commercial computing-
government organization ,financial situations and commercial enterprises organize much of this information by sorting it. whether the information is accounts to be sorted by name and number ,transaction to be sorted by time or place ,mail to be sorted by postal code or adddress ,files to be sorted by name or date or wwhatever processing such data is sure to involve a sorting algorithm somewhere along the way.
search for information-
keeping data in sorted order makes it possible to effeciently search through it using the classic bianary search algorithm.
sorting various types of data -
pointer sorting-
the approach we are using is known in the clasical literature as pointer sorting ,so called because we process references to keys and do not ove data itself
keys are immutable-
it stand to reason that an array might not remain sorted if a client is allowed to change thevalues of keys after the sort .in java it is wise to ensure that keys values do not change by using immuatble keys.
stability-
a sorting method is stable if it preserve the relative order of equal keys inthe array .

