Data structures is an AI agent skill from the GitHub repository rnavarych/alpha-engineer. Implements and selects optimal data structures — hash tables (chaining, open addressing, Robin Hood, cuckoo), balanced BSTs (AVL, Red-Black, B-trees), heaps (binary, Fibonacci, pairing), tries, skip lists, segment trees, Fenwick trees, Bloom filters, Count-Min Sketch, HyperLogLog, and Union-Find. Us
Claude Code: save it as .claude/skills/data-structures/SKILL.md
Cursor: save it as .cursor/rules/data-structures.md
Codex: save it as .agents/skills/data-structures/SKILL.md
ChatGPT, Gemini and other assistants: paste it into custom or project instructions
Skill file
Data Structures
When to use
Choosing the right data structure before writing a collection or lookup mechanism
Implementing custom hash tables, trees, or heaps with specific performance requirements
Selecting between approximate data structures (Bloom filter, HyperLogLog, Count-Min Sketch)
Optimizing range queries or prefix operations on arrays
Implementing dynamic connectivity or equivalence class tracking
Moving from in-memory to disk-based storage structures
Core principles
Access pattern first — select for how the structure is queried, not what is most familiar
Load factor controls hash table performance — keep below 0.75 for open addressing
B-trees exist because disks exist — in-memory trees should not use disk-page logic
Segment tree when updates + queries interleave; Fenwick tree for prefix-only — do not overengineer
Union-Find is underused — path compression + union by rank gives near-O(1) for connectivity
Reference Files
references/hash-and-trees.md — hash collision strategies (chaining, open addressing, Robin Hood, cuckoo), perfect hashing, AVL vs Red-Black vs B-tree selection matrix
references/heaps-and-advanced.md — binary/d-ary/Fibonacci/pairing heap trade-offs, tries, radix trees, segment trees with lazy propagation, Fenwick trees, skip lists
references/probabilistic-and-unionfind.md — Bloom filters (optimal k formula, counting variant), Count-Min Sketch, HyperLogLog, Union-Find with path compression and union by rank, full selection decision matrix
Use this skill with your AI agent:Open on Skill Issue to copy, download, or add to your library.
Works with Claude, ChatGPT, Gemini, Cursor, Windsurf and more.