|The C5 Generic Collection Library|
|for C# and CLI||
The C5 Generic Collection Library
C5 is a library of generic collection classes for C# and other CLI
languages and works with Microsoft .Net version 2.0 and later, and
Mono version 2 and later.
C5 provides functionality and data structures not provided by the
standard .Net System.Collections.Generic namespace, such as persistent
tree data structures, heap based priority queues, hash indexed array
lists and linked lists, and events on collection changes. Also, it is
more comprehensive than collection class libraries on other similar
platforms, such as Java. Unlike many other collection class
libraries, C5 is designed with a strict policy of supporting "code to
interface not implementation".
- 25 May 2011: Version 2.0.0 released
at Github and NuGet.
This version has been updated to fit the new features of C# 3.0 and C#
4.0 and to be portable to WP7, Silverlight, Xbox and Mono. It is
not backwards compatible because eg. C5.Fun<R> has been replaced
with System.Func<R> and so on. There is a document
describing the changes and rationale.
Thanks to Rasmus Nielsen at the IT University for the good work and
to many users, not least Marcus Griep, for suggestions and
- 17 December 2010:
Version 1.1.1 released. Fixes the five bugs found since February
See Release Notes 1.1.1.
- 10 February 2008:
Version 1.1.0 released. Adds implementation of some .NET Framework
class library interfaces and fixes the six bugs found since June 2007.
Release Notes 1.1. The book about C5 has been
- 8 January 2008:
video with an interview about C5 at MSDN Channel 9 (45 minutes).
- 1 July 2007: Here's an article in Dr Dobb's
- 30 May 2007: Version 1.0.2 released. It fixes the three
bugs found since June 2006. See
Release Notes 1.0.2.
- 27 June 2006: Version 1.0.1 released. All known bugs (six)
have been fixed, two feature requests
accommodated, and the book has been updated. See
Release Notes 1.0.1.
- 30 January 2006: Version
Downloads and resources
The C5 collection library provides the following collection concepts,
described by C# interfaces: Directed enumerable, collection value,
directed collection value, extensible collection, collection,
sequenced collection, indexed collection, sorted collection, indexed
sorted collection, persistent sorted collection, list, LIFO stack,
FIFO queue, priority queue, dictionary, and sorted dictionary.
The C5 collection library provides the following data structures,
described by C# classes: array list, doubly linked list, hash-indexed
array list, hash-indexed linked list, hash set, hash bag (multiset),
sorted array, wrapped array, tree set, tree bag (multiset), stack,
double-ended queue, circular queue, priority queue (interval heap),
hash dictionary, and tree dictionary.
See the relation between interfaces and classes for collections and for dictionaries.
The C5 collection library provides the following unusual
functionality on collections and dictionaries: collection update
events, multiple updatable list views, reversible enumeration, hash
indexes on lists, snapshottable tree-based collections, priority
queues with item handles, and in general a design with emphasis on
orthogonality, flexibility, and preservation of invariants.
Authors, license and credits
The library is Copyright 2003-2016 Niels Kokholm, Peter Sestoft and
Rasmus Lystroem and is released under
an MIT-style open license.
It is based on the
GCollections library created by Peter Sestoft during his
visit to Microsoft Research, Cambridge in 2001. Niels Kokholm
extended the library as a Master's
thesis project at the IT
University of Copenhagen, advised by Peter Sestoft. Subsequent completion of the
library was financed in part by a grant from Microsoft Research
Bug reports, feedback and suggestions are welcome, preferably at
the Github C5 project
site or else to firstname.lastname@example.org.
Niels Kokholm and Peter Sestoft; last update 2016-09-06