Click or drag to resize

Version History

KwCollections version 2.1.0 (2012-03-06)
  • Adds support for range queries.
  • Adds optimized implementation of Last().
KwCollections version 2.1.1 (2012-03-28)
  • Removes possible code coverage artifacts from .dll file.
  • Initial release of documentation.
KaosCollections version 3.0.0 (2017-10-01)

This release updates tooling to 2017. The new .NET Standard has been embraced for compatibility and future-proofing. Development now requires Visual Studio 2017 with the repository changed to Git. Binary now hosted at NuGet.org.

  • Renames root namespace from Kw to Kaos.
  • Changes binary to .NET Standard 1.0 multitargeted to .NET 4.5, 4.0, 3.5.
  • Renames BtreeDictionary class to RankedDictionary with improved SortedDictionary emulation and enhanced with partial SortedList emulation.
  • Adds RankedSet generic class which emulates SortedSet with indexing.
  • Adds RankedBag generic class which provides a sorted and indexed multiset.
  • Optimizes many operations for time and space.
KaosCollections version 3.0.0.2 (2017-10-31)

This release updates documentation only.

KaosCollections version 3.1.0 (2017-11-11)

This release fixes a data corruption bug in RankedDictionary and enhances it and its subcollections.

  • Fixes potential RankedDictionary mismatched key/value after remove operation.
  • Enhances RankedDictionary:
    • Adds RemoveWhereElement method.
  • Enhances RankedDictionary.KeyCollection, RankedDictionary.ValueCollection:
    • Adds indexer property for array semantics.
    • Adds ElementAt, ElementAtOrDefault, IndexOf methods.
  • Updates documentation.
KaosCollections version 4.1.0 (2018-02-15)
  • Adds the RankedMap<TKey,TValue> class.
  • Optimizes the RemoveWhere and RemoveWhereElement methods.
  • Adds various LINQ-signatured methods as instance methods to improve performance.
  • Adds Replace and various TryGet methods.

The new RankedMap generic class is similar to RankedDictionary but with duplicate keys allowed. Therefore, RankedMap is to RankedDictionary what RankedBag is to RankedSet. Like RankedBag, methods such as ElementAt and IndexOf are not implemented since keys are not distinct. Also like RankedBag, the methods GetDistinctCount and GetCount(key) are implemented.

Previous versions of RemoveWhere degraded ungracefully when more than a few items were actually removed. In worst case if all items are removed for a large collection, the time spent is 40 times that if no items are removed. With this optimization, this penalty is reduced to 2 times that if no items are removed.

Methods First, Last, and Contains and enumerators Distinct and Reverse have been added to additional classes as instance methods to improve performance over their LINQ counterparts.

TryGet and Replace methods have been added to various classes. These methods combine what could be accomplished in multiple operations into a single operation in order to improve performance and reduce heap allocations.

KaosCollections version 4.2.0 (2019-01-01)

Summary

  • Adds optimized Skip and SkipWhile instance methods.
  • Improves enumerator compatibility with Microsoft's Base Class Library.
    • All enumerator types have been converted from class to struct.
    • Calls to the Current property will succeed following updates to the underlying class.

Details

Adds optimized Skip and SkipWhile instance methods

Microsoft's IEnumerable version of Skip performs an item-by-item fetching on the target structure. Such an inefficient scan can be optimized when the underlying structure has indexing capability. The instance method versions of Skip in this library execute in logarithmic time rather than scalar time. This optimization applies to any Skip call following any number of Skip or SkipWhile calls.

All enumerator types have been converted from class to struct

This change is to align with BCL types. While it is unlikely that class versus struct is relied on, this is a breaking change for such an edge case.

Calls to the Current property will succeed following updates to the underlying class

Microsoft's enumerators permit calls to the Current property after their underlying data structure has been modified. The returned value is whatever a call to Current would have returned before the update. KaosCollections now emulates this behavior.

Previous versions of this library threw an exception here. While it is unlikely that a codebase would rely on an exception, this is a potential breaking change.

See Also