Mirror of space-wizards/DataStructures
Find a file
Denis Shulepov 8678c13e7a Merge pull request #7 from JulianMay/master
Added constructor overload for injecting IComparer<T>
2017-04-04 08:20:59 -07:00
DataStructures Merge pull request #7 from JulianMay/master 2017-04-04 08:20:59 -07:00
Tests Update ConcurrentPriorityQueueTests.cs 2017-02-09 21:14:53 +08:00
.gitattributes Initial commit to add default .gitIgnore and .gitAttribute files. 2015-08-20 16:40:14 +02:00
.gitignore Initial commit to add default .gitIgnore and .gitAttribute files. 2015-08-20 16:40:14 +02:00
DataStructures.sln Added nuspec to solution 2015-11-15 15:21:15 +01:00
License.md Add draft read me and license 2015-08-27 23:16:33 +02:00
README.md Minor fix in ConcurrentPriorityQueue.TryAdd 2015-10-05 21:49:08 +02:00

C# implementations of some usefull data sctructures for .NET

##Priority queue Heap-based generic concurrent priority queue for .NET

Priority queue is an abstract data type which is like a regular queue or stack data structure, but where additionally each element has a "priority" associated with it. In a priority queue, an element with high priority is served before an element with low priority. If two elements have the same priority, they are served according to their order in the queue.

###Features

  • Generic
  • Thread-safe using ReaderWriterLockSlim
  • Performant
    • Take max item, Insertion, Removal - O(N log N)
  • Resizable (queue grows and shrinks depending on the number of items)

#NuGet

###Applications

##Skip list Generic concurrent skiplist for .NET

This data structure makes random choices in arranging the entries in such a way that search and update times are O(log N) on average, where N is the number of entries in the list. Interestingly, the notion of average time complexity used here does not depend on the probability distribution of the keys in the input. Instead, it depends on the use of a random-number generator in the implementation of the insertions to help decide where to place the new entry. [Detailed overview] (https://msdn.microsoft.com/en-us/library/ms379573(VS.80).aspx#datastructures20_4_topic4) of skip list and a simple implementation.

###Features

  • Generic
  • Thread-safe using ReaderWriterLockSlim
  • Performant
    • Take min or max item - O(1)
    • Insertion, Removal, Check if contains - O(log N)
    • Enumeration in order - O(N)
  • Additional operations
    • Get Floor and Clealing items - O(log N)
    • Get items in range O(log N + K) (where K is number of items in result)

###Applications

#License Released under the MIT license.