Friday, September 10, 2010

C # Dictionary

# AC Dictionary is a data structure that contains a pair of values instead of a single value. And 'useful in a variety of sophisticated algorithms.

AC # structure dictionary sense, because the values are stored in pairs, an important and valuable component. The keys are used to access values, then the key must be unique, while the values should not be.

The data structure dictionary is a very general concept in programming. The data structure can be implemented in many ways,each of which has its advantages and disadvantages.

There are two things to note, the rate of inclusion of elements in a dictionary, and the speed of the elements of user. (More work is to eliminate similar in terms of speed or insertion, or watch.)

Consider first the insert speed. One thing that can make the dictionary, is to sort the items they are introduced. This would be a slow process. Second chance to insert elements in a case (or seemingly random) order, which wouldbe very fast. The third option is to keep the items in the order they were entered. Intuitively, it will be quicker to place fine, but it is slower than inserting them at random.

Secondly, consider the scanning speed. If items in the order they were entered shall be the average speed is the time to talk about research so that (O (log n)). If the items in an orderly way, users can use the binary search which is much faster (O (log n)). Finally, when the items were in random order, we canLook for an item in the same way "random, so that the search faster (O (1)) speed.

Leads us to three # Dictionary of implementation in C.

Dictionary - This class is replaced by the order in which items were included ("medium", enter the speed) and then trying to speed average O (n log n).

SortedDictionary - This class will be possible to place items that are used (low speed), but searches faster (O (log N), speed).

Hashtable - This class adds elements of "accidental" (based on hashEntry value), which is faster and faster time to time enter search (O (AN)). Note that this class seems too good to be true, because it is. rates of return are only good if the values of assets to minimize the collision hash (for more information on hash tables.) Minimizing collisions usually requires some knowledge about the types of objects and not saved from the start.

No comments:

Post a Comment