Practical and robust .NET-styled implementations of advanced data structures in C#, in which data structure classes are wrapped in .NET style and can get handy usage in .NET codes. Moreover, structures here are extendable for maintaining extra information for algorithm problems (e.g. assignments on Online Judges and ACM);
This repository is originally a playground for learning Data Structure class of Tsinghua Univerity, (Class Info Here), and also for reading the book Introduction to Algorithms. So data structures implemented here are mainly from the class and the book, but also some from Wiki pages.
The Project uses Contracts, thus the installation of code analyser like Code Contracts for .NET extension for VS is needed.
The final goal of this project is to implement Advanced data structures listed in the List of Data Structures in wiki.
Primitive data structures following implemented by the .NET framework will not be re-implemented.
- Array / Vector
- ArrayList
- Associate Array (IDictionary)
- Bit Array(Bitboard and Bitmap is similar to this)
- Bag (ICollection)
- Dynamic Array (List)
- Hash Table
- Image
- (Doubly-)Linked List(implements as cyclic, but do not expose cyclic interfaces)
- Queue(implements Circular Buffer)
- Set
- Sorted Array (SortedList)
- Stack
Simple data structure based on these structure (like Double-ended Queue(deque)(can be implemented with Doubly-Linked List), Matrix(can be implemented with Two-Dimension Array), Height Map), and some kinds of data structures which are programming tricks more than complete structures (like Bit field, Circular buffer, Control Table, Lookup table, Parallel array, Iliffe vector) will not be implemented here as well.
Algorithms implementations are not the goal of this project, but some of them will obviously be implemented when implementing data structures. And algorithm associated will implemented as much as possible.
- AVL Tree
- Binary Search Tree - 二叉搜索树
- Binary Tree - 二叉树
- Cartesian Tree - 笛卡尔树 (a.k.a Randomized Binary Search Tree)
- Doubly-chained Tree - 双链树 (a.k.a Left-child right-sibling binary tree, filial-heir chain)
- Splay Tree - 伸展树
- Threaded Binary Tree - 线索二叉树
- Treap - 树堆
- B Trees (AA tree, B*, B+, 2-3 tree, 2-3-4 tree, (a,b)-tree)
- Binomial Heap - 二项堆
- Disjoint Set - 并查集
- Fenwick Tree - 树状数组
- Gap Buffer
- Interval Tree - 区间树
- KD Tree
- Leftist - 左式堆/左偏堆
- Quadtree - 四叉树/四分树
- Range Tree - 范围树
- Red Black Tree - 红黑树
- Segment Tree - 线段树
- Self-organizing List
- Size Balanced Tree - SBT
- Skip List - 跳表
- Sparse Matrixes - 稀疏矩阵
- Trie - 键树
- Xor Linked List & Free List
- Bloom Filter
- Conc-Tree List
- Octree - 八叉树
- Fibnacci Heap - 斐波那契堆
- Skew Heap - 斜堆
- Stree (research paper here)
- VList (research paper here, examples)
- Dictionary based on BST: Implement IDictionary and ICollection
- Splay List: List that supports range insert/remove/edit/reverse operations in O(lgn) time per element.
- Tree Traverse (in/pre/post/level order)
- Binary: Naive Ver, Robust Ver
- Multiway: Naive Ver
- Tree Classification (perfect/full/strict/complete)
- Heap Sort
Turn to Example Usages for more usage of these data structures.
- Data Structure, Tsinghua Univerity, credit to Junhui Deng
- Introduction to Algorithms, the 3rd Edition
- Data Structure Pages in Wiki
- Dictionary of Algorithms and Data Structures (DADS)
- Other github repos (like ones of aalhour, riyadparvez, vosen, BenFradet, lkitching, luchunminglu, l1pton17, TelerikAcademy, phishman3579)
- Useful Data Structures