Skip to content

Latest commit

 

History

History
33 lines (25 loc) · 1.14 KB

README.md

File metadata and controls

33 lines (25 loc) · 1.14 KB

MCollections

in .NET, two data structures are useful when you need data to be sorted:

MCollections provided two collections with insert, edit, remove, search and index lookup In O(Lg(N)).

download using NuGet: MCollections

IndexedDictionary<TKey, TValue>

IndexedDictionary<string, int> dictionary = new IndexedDictionary<string, int>()
{
    { "Zero", 0 },
    { "One", 1 },
    { "Two", 2 },
};
int valueWithIndex2 = dictionary.GetByIndex(2); // 0
int someValue = dictionary["One"]; // 1

IndexedSet< T >

IndexedSet<string> set = new IndexedSet<string>();
set.Add("two");
set.Add("one");
set.Add("zero");
string first = set[0]; // "one"