You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: DATA_STRUCTURES.md
+10-3
Original file line number
Diff line number
Diff line change
@@ -1,12 +1,17 @@
1
1
# Data Structures
2
2
3
+
!!!
3
4
For Rust specific visualization of the metadata for heap containers (e.g. Box, Vec, Rc, Arc, Cell) checkout https://docs.google.com/presentation/d/1q-c7UAyrUlM-eZyTo1pd8SZ0qwA_wYxmPZVOQkoDmH4/edit#slide=id.p
4
5
5
6
## Overview
6
7
7
-
Eventually we expect to add links. For now, visit the [src](src/data_structures/) directory to see the progress on various data structures, including:
8
+
Many of these data structures are implemented in Rust's standard library as collections ([std::collections](https://doc.rust-lang.org/std/collections/index.html)) or there are crates which are well vetted. There are still occasions where a requirement for extreme efficiency may lead to the need for custom implementation but that is out of scope. The goal of this section is to provide a high-level overview of the most common data structures and their use cases.
9
+
10
+
The [Rust docs](https://doc.rust-lang.org/std/collections/index.html) also cover much of the same ground and goes more in depth so each implementation is also linked to for further study. The Rust docs also provide a good overview of the [tradeoffs between the different types of collections](https://doc.rust-lang.org/std/collections/index.html#tradeoffs)
11
+
12
+
## Sequence Containers
8
13
9
-
### Linear Structures (Sequence Containers)
14
+
### Linear Structures
10
15
-**Array**: Stores elements in a contiguous block of memory.
11
16
-**Dynamic Array (ArrayList)**: Similar to an array but allows resizable storage.
12
17
-**Linked List**: Consists of nodes with data and references to the next node in the sequence.
@@ -18,12 +23,15 @@ Eventually we expect to add links. For now, visit the [src](src/data_structures/
18
23
-**Queue**: A FIFO (First In, First Out) data structure.
19
24
-**Priority Queue**: Elements are removed based on priority, not just insertion order.
20
25
26
+
## Associative Structures
27
+
21
28
### Tree and Heap Structures
22
29
-**Binary Tree**: A tree where each node has at most two children.
23
30
-**Binary Search Tree (BST)**: A binary tree maintaining order among elements for efficient search.
24
31
-**Balanced Trees**: Including AVL, Red-Black, and Splay trees.
25
32
-**Heap**: A tree-based structure satisfying the heap property.
26
33
-**B+ Tree**: A type of tree that maintains sorted data and allows searches, sequential access, insertions, and deletions in logarithmic time.
34
+
-**Trie**: A tree-like structure for efficient retrieval of keys in a dataset of strings.
27
35
28
36
### Associative Structures
29
37
-**Hash Table**: Maps keys to values, implementing an associative array.
@@ -35,7 +43,6 @@ Eventually we expect to add links. For now, visit the [src](src/data_structures/
35
43
-**Graph Variants**: Includes directed, undirected, and weighted graphs.
36
44
37
45
### Advanced and Specialized Structures
38
-
-**Trie**: A tree-like structure for efficient retrieval of keys in a dataset of strings.
39
46
-**Skip List**: A probabilistic structure allowing fast search, insertion, and deletion.
40
47
-**Union-Find (Disjoint Set)**: Keeps track of elements partitioned into disjoint subsets.
0 commit comments