daily.dev

Data Structures in Rust

Vector

A resizable array, implemented as a contiguous growable array type.

HashMap

A hash map implemented with quadratic probing and SIMD lookup.

LinkedList

A doubly-linked list.

BinaryHeap

A priority queue implemented with a binary heap.

HashSet

A hash set implemented as a HashMap where the value is ()

BTreeMap

A map based on a B-Tree.

BTreeSet

A set based on a B-Tree.

VecDeque

A double-ended queue implemented with a growable ring buffer.

Binary Search Tree

A basic binary search tree implementation.

Trie

A prefix tree for efficient storage and retrieval of strings.

Graph (Adjacency List)

A simple graph representation using an adjacency list.

Stack

A simple stack implemented with a Vec.

Queue

A simple queue implemented with a VecDeque.

Deque

A double-ended queue implemented with a VecDeque.

Circular Buffer

A ring buffer implemented with a fixed-size array.

Bloom Filter

A probabilistic data structure to test whether an element is a member of a set.

Segment Tree

A tree data structure for storing intervals, or segments.

Fenwick Tree

A tree data structure that provides efficient methods for calculation and manipulation of prefix sums.

LRU Cache

A cache that stores a fixed number of items and discards the least recently used items first.

Red-Black Tree

A self-balancing binary search tree.