sort


Also found in: Dictionary, Thesaurus, Medical, Legal, Acronyms, Idioms, Wikipedia.
Related to sort: sort out, Sort algorithm

sort

[sȯrt]
(computer science)
To rearrange a set of data items into a new sequence, governed by specific rules of precedence.
The program designed to perform this activity.

sort

(application, algorithm)
To arrange a collection of items in some specified order. The items - records in a file or data structures in memory - consist of one or more fields or members. One of these fields is designated as the "sort key" which means the records will be ordered according to the value of that field. Sometimes a sequence of key fields is specified such that if all earlier keys are equal then the later keys will be compared. Within each field some ordering is imposed, e.g. ascending or descending numerical, lexical ordering, or date.

Sorting is the subject of a great deal of study since it is a common operation which can consume a lot of computer time. There are many well-known sorting algorithms with different time and space behaviour and programming complexity.

Examples are quicksort, insertion sort, bubble sort, heap sort, and tree sort. These employ many different data structures to store sorted data, such as arrays, linked lists, and binary trees.

sort

(tool)
The Unix utility program for sorting lines of files.

Unix manual page: sort(1).

sort

(1) To reorder data into a new sequence. See sorter, counting sort, bubble sort, quick sort and selection sort.


A Punch Card Sorter in 1917
Cards were sorted one digit at a time (a 10-digit account number required 10 passes). A great year to have bought stock. (Image courtesy of IBM.)






(2) An external DOS/Windows command that sorts a text file into alphabetical order, providing the text columns are uniform. The following example sorts the text file 1.TXT (starting at character position 1), creating 2.TXT. The < means "input from," and the > means "output to."
sort < 1.txt > 2.txt      a to z
  sort < 1.txt > 2.txt /r   z to a


SORT ON A MIDDLE COLUMN
If city begins in character position 60 in 1.TXT, the following examples create 2.TXT in city sequence:
sort /+60 < 1.txt > 2.txt      a to z
  sort /+60 < 1.txt > 2.txt /r   z to a
References in classic literature ?
It was of the broad, square sort with great jaws, almost like that of a highly intellectual ape; the wide mouth shut so tight as to be traced by a mere line; the nose short with the sort of nostrils that seem to gape with an appetite for the air.
Why, Mr Moore," he begins, sort of soothing; when the small brother, who's been staring at Jerry, chips in.
I have plenty of ideas and facts, you know, and I can see he is just the man to put them into shape--remembers what the right quotations are, omne tulit punctum, and that sort of thing--gives subjects a kind of turn.
He was one of those nervous, stand-off sort of persons who hated to have people talk to him and yet was always doing things to make them talk about him.
I owe you the idea, however, so I will tell you the sort of person I shall look out for.
I see 'em now when I shut my eyes; black balls bobbing round, and stars and all sorts of queer things.
For if you accepted he was relieved of you with every appearance of humanity, and if you made objections (after requesting his assistance, mind you) it was open to him to drop you as a sort of impostor.
Indeed, he said, I am strongly of opinion that they ought not to hear that sort of thing.
He was very tall and slight, and light-haired; his nose had a high bridge, and he might almost have been handsome in a spectral sort of way; but he had one of the most appalling squints I have ever seen or heard of.
Fentolin has been making a sort of hobby of the place.
It is this sort of occurrence that constitutes the essence of memory Until we have analysed what happens in such a case as this, we have not succeeded in understanding memory.
No sort of necessity," she thought, "for a man to come and say good-bye to the woman he loves, for whom he was ready to ruin himself, and has ruined himself, and who cannot live without him.