|
7 | 7 | <h2>Ordered</h2> |
8 | 8 |
|
9 | 9 | [](https://github.com/CogitatorTech/ordered/actions/workflows/tests.yml) |
10 | | -[](https://github.com/CogitatorTech/ordered/actions/workflows/benches.yml) |
| 10 | +[](https://github.com/CogitatorTech/ordered/actions/workflows/benches.yml) |
11 | 11 | [](https://www.codefactor.io/repository/github/CogitatorTech/ordered) |
| 12 | +[](https://ziglang.org/download/) |
| 13 | +<br> |
12 | 14 | [](https://CogitatorTech.github.io/ordered/) |
13 | 15 | [](https://github.com/CogitatorTech/ordered/tree/main/examples) |
14 | | -[](https://ziglang.org/download/) |
15 | 16 | [](https://github.com/CogitatorTech/ordered/releases/latest) |
16 | 17 | [](https://github.com/CogitatorTech/ordered/blob/main/LICENSE) |
17 | 18 |
|
18 | | -A collection of data structures that keep data in order in pure Zig |
| 19 | +Pure Zig implementations of high-performance, memory-safe ordered data structures |
19 | 20 |
|
20 | 21 | </div> |
21 | 22 |
|
22 | 23 | --- |
23 | 24 |
|
24 | | -Ordered is a Zig library that provides fast and efficient implementations of various popular data structures including |
| 25 | +Ordered is a Zig library that provides efficient implementations of various popular data structures including |
25 | 26 | B-tree, skip list, trie, and red-black tree for Zig programming language. |
26 | 27 |
|
27 | | -### Supported Data Structures |
| 28 | +### Features |
28 | 29 |
|
29 | | -Currently supported data structures include: |
| 30 | +To be added. |
30 | 31 |
|
31 | | -- [B-tree](src/ordered/btree_map.zig): A self-balancing search tree where nodes can have many children. |
32 | | -- [Sorted Set](src/ordered/sorted_set.zig): A data structure that stores a collection of unique elements in a consistently sorted order. |
33 | | -- [Skip List](src/ordered/skip_list.zig): A probabilistic data structure that uses multiple linked lists to create "express lanes" for fast, tree-like search. |
34 | | -- [Trie](src/ordered/trie.zig): A tree where paths from the root represent prefixes which makes it extremely fast for tasks like text autocomplete. |
35 | | -- [Red-black Tree](src/ordered/red_black_tree.zig): A self-balancing binary search tree that uses node colors to guarantee efficient operations. |
36 | | -- [Cartesian Tree](src/ordered/cartesian_tree.zig): A binary tree that uniquely combines a binary search tree property for its keys with a heap** property for its values. |
| 32 | +### Data Structures |
37 | 33 |
|
38 | | -| # | Data Structure | Build Complexity | Memory Complexity | Search Complexity | |
39 | | -|---|----------------|------------------|-------------------|----------------------| |
40 | | -| 1 | B-tree | $O(\log n)$ | $O(n)$ | $O(\log n)$ | |
41 | | -| 2 | Cartesian tree | $O(\log n)$\* | $O(n)$ | $O(\log n)$\* | |
42 | | -| 3 | Red-black tree | $O(\log n)$ | $O(n)$ | $O(\log n)$ | |
43 | | -| 4 | Skip list | $O(\log n)$\* | $O(n)$ | $O(\log n)$\* | |
44 | | -| 5 | Sorted set | $O(n)$ | $O(n)$ | $O(\log n)$ | |
45 | | -| 6 | Trie | $O(m)$ | $O(n \cdot m)$ | $O(m)$ | |
| 34 | +| Data Structure | Build Complexity | Memory Complexity | Search Complexity | |
| 35 | +|------------------------------------------------------------------------|------------------|-------------------|-------------------| |
| 36 | +| [B-tree](https://en.wikipedia.org/wiki/B-tree) | $O(\log n)$ | $O(n)$ | $O(\log n)$ | |
| 37 | +| [Cartesian tree](https://en.wikipedia.org/wiki/Cartesian_tree) | $O(\log n)$\* | $O(n)$ | $O(\log n)$\* | |
| 38 | +| [Red-black tree](https://en.wikipedia.org/wiki/Red%E2%80%93black_tree) | $O(\log n)$ | $O(n)$ | $O(\log n)$ | |
| 39 | +| [Skip list](https://en.wikipedia.org/wiki/Skip_list) | $O(\log n)$\* | $O(n)$ | $O(\log n)$\* | |
| 40 | +| Sorted set | $O(n)$ | $O(n)$ | $O(\log n)$ | |
| 41 | +| [Trie](https://en.wikipedia.org/wiki/Trie) | $O(m)$ | $O(n \cdot m)$ | $O(m)$ | |
46 | 42 |
|
47 | 43 | - $n$: number of stored elements |
48 | 44 | - $m$: maximum length of a key |
@@ -72,6 +68,10 @@ and view in a web browser. |
72 | 68 |
|
73 | 69 | Check out the [examples](examples) directory for example usages of Ordered. |
74 | 70 |
|
| 71 | +### Benchmarks |
| 72 | + |
| 73 | +To be added. |
| 74 | + |
75 | 75 | --- |
76 | 76 |
|
77 | 77 | ### Contributing |
|
0 commit comments