jwalsh / jwalsh/hy-algorithms

Implement efficient hash table data structure

Open
#7 0 comments 0 reactions 0 assignees View on GitHub
data-structure difficulty:medium hash-table
Dominant language
Hy
Stars
2
Forks
0
PR merge metrics
No merged PRs in 30d

Description

Create a custom hash table implementation in Hy:

## Implementation Requirements:
- Create a hash table class with standard operations (get, put, delete)
- Implement collision resolution using either:
- Separate chaining (linked lists)
- Linear probing
- Quadratic probing
- Double hashing
- Add features for dynamic resizing and load factor management
- Implement efficient hash functions for different data types
- Support for custom key types with proper hash function protocols

## Documentation Requirements:
- Clear explanation of design choices
- Performance characteristics
- Usage examples
- Complexity analysis for all operations

## Testing Requirements:
- Basic operations
- Edge cases (empty table, duplicate keys)
- Performance benchmarking against Python's built-in dict
- Collision handling tests

This will provide a foundational data structure that can be used in other algorithms.

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.