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 ?
Then, as if sincerely repentant of his nonchalance, he added, with a sort of enthusiasm:
As if fired by his own words, he took a sort of leap at the ledges of the rock above him, and scaled them with a sudden agility in startling contrast to his general lassitude.
"I will give the afternoon to that sort of people," he said.
The police work he had been engaged on in a distant part of the globe had the saving character of an irregular sort of warfare or at least the risk and excitement of open-air sport.
He had discovered in this affair a delicate and perplexing side, forcing upon the discoverer a certain amount of insincerity - that sort of insincerity which, under the names of skill, prudence, discretion, turns up at one point or another in most human affairs.
Suppose, I answered, that a just and good man in the course of a narration comes on some saying or action of another good man,-- I should imagine that he will like to personate him, and will not be ashamed of this sort of imitation: he will be most ready to play the part of the good man when he is acting firmly and wisely; in a less degree when he is overtaken by illness or love or drink, or has met with any other disaster.
But there is another sort of character who will narrate anything, and, the worse lie is, the more unscrupulous he will be; nothing will be too bad for him: and he will be ready to imitate anything, not as a joke, but in right good earnest, and before a large company.
He had evidently been schooling himself as to all sorts of little things, and remembered them, but he almost managed to sit down on his silk hat, which men don't generally do when they are cool, and then when he wanted to appear at ease he kept playing with a lancet in a way that made me nearly scream.
But before I made it, in a sort of desperation, I pressed a long kiss into the hollow of her throat.
"I was just going to see Miss Tuxton home," he says, sort of wistful.
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.
Was there furniture--in fact, any sort of thing in the room?"