MODERN PROGRAMMING TOOLS AND TECHNIQUES-1
Sorting is any process of arranging items in some sequence and/or in different sets, and accordingly, it has two common, yet distinct meanings:
1. ordering: arranging items of the same kind, class, nature, etc. in some ordered sequence,
2. Categorizing: grouping and labeling items with similar properties together (by sorts).
Sorting information or data
For sorting we can either specify a weak order "should not come after" or a strict weak order "should come before" (specifying one defines also the other, the two are the complement of the inverse of each other, see operations on binary relations). For the sorting to be unique, these two are restricted to a total order and a strict total order, respectively.
Sorting n-tuples (depending on context also called e.g. records consisting of fields) can be done based on one or more of its components. More generally objects can be sorted based on a property. Such a component or property is called a sort key.
For example, the items are books, the sort key is the title, subject or author, and the order is alphabetical.
A new sort key can be created from two or more sort keys by lexicographical order. The first is then called the primary sort key, the second the secondary sort key, etc.
For example, addresses could be sorted using the city as primary sort key, and the street as secondary sort key.
If the sort key values are totally ordered, the sort key defines a weak order of the items: items with the same sort key are equivalent with respect to sorting. See also stable sorting. If different items have different sort key values then this defines a unique order of the items.
A standard... [continues]
Cite This Essay
(2011, 11). Java Sorting Techniques. StudyMode.com. Retrieved 11, 2011, from http://www.studymode.com/essays/Java-Sorting-Techniques-848637.html
"Java Sorting Techniques" StudyMode.com. 11 2011. 11 2011 <http://www.studymode.com/essays/Java-Sorting-Techniques-848637.html>.
"Java Sorting Techniques." StudyMode.com. 11, 2011. Accessed 11, 2011. http://www.studymode.com/essays/Java-Sorting-Techniques-848637.html.