Data Structures Overview
This section contains comprehensive documentation for all data structures implemented in the algo-py library.
Available Data Structures
Arrays & Lists
- Dynamic Array: Resizable array implementation with automatic capacity management
- Singly Linked List: Linear data structure with forward-only traversal
- Doubly Linked List: Linear data structure with bidirectional traversal
- Circular Linked List: Linked list where the last node points back to the first
Stacks & Queues
- Stack: LIFO (Last In, First Out) data structure
- Queue: FIFO (First In, First Out) data structure
- Deque: Double-ended queue supporting operations at both ends
Hash Tables
- Hash Map: Key-value store using hash functions for fast access
- Hash Set: A Set data structure storing unique elements
Trees
- Binary Tree: Hierarchical data structure with at most two children per node
- Heap: Complete binary tree maintaining heap property (min or max)
Graphs
- Adjacency List Graph: Memory-efficient graph using adjacency lists
- Adjacency Matrix Graph: Fast edge lookup graph using adjacency matrix
Strings
- Trie (Prefix Tree): Efficient storage and retrieval of strings with shared prefixes
- Suffix Tree: Compressed trie containing all suffixes of a text
- Suffix Array: Space-efficient alternative to suffix trees
Data Structures Features
Each data structure implementation includes:
- Time complexity analysis for all operations
- Space complexity requirements
- Use cases and examples
- Implementation details