Friday 15 August 2014

c++ - What's the difference between ordering and sorting? -


No, this is not a question from a class, I studied trees and heaps (partially sorted binary tree) I was wondering how to correctly define this 2 properties / verb in relation to a normal data structure.

  • An " order " is basically A set of rules that determines which items come first or later, other items what IE: relative order items will appear if they are sorted. For ordering archives, the ordering order is usually the interface of the comparable operator (especially ) ( Comparable of ), Or compare callbacks and / or function objects (like std :: less of C ++).

    There are also collections described as " Order Collection ". A little different use of the word, but related meaning. What does it mean that the collection represents an sequence , and thus there is some underlying concept in order (on the contrary, say, hash tables. You add something to a hash table, You do not know that if you ever repeat the material, the order will be seen.) The lists of inventory, vectors, arrays, etc. are popular order collections, for example a non-list example, "array" of PHP Rkar was actually a "command map" is ???? A dictionary type where the key sequence is retained. The key appears in the order in which they were inserted for the first time (or in the order in which you had previously put them with ksort () or the choice) when you iterate over the array.

  • " Sorting " is actually the process of arranging sequences of objects according to the given sequence; it is usually only with the collection of orders ... because it is not an item that does not have any concept of "first" in one of the containers or will not allow you to rearrange the objects in the first place. (Structures like set and pile can also use an order, and by adding and removing entries, the underlying tree is changed based on the ordering. No argument can be argued that they are biting "sorting" by bit But the word is usually used to represent an operation that makes everyone regenerate once again.)

No comments:

Post a Comment