-
-
Notifications
You must be signed in to change notification settings - Fork 0
Open
Labels
enhancementNew feature or requestNew feature or requesthelp wantedExtra attention is neededExtra attention is needed
Description
Problem
The library has stl_map and stl_set, but is missing their hash-based (O(1) average) and multi-key variants. These are among the most used containers in C++ STL, especially in competitive programming.
Missing Containers
| Container | C++ Equivalent | Key Feature |
|---|---|---|
unordered_map |
std::unordered_map<K,V> |
Hash map, avg O(1) lookup |
unordered_set |
std::unordered_set<T> |
Hash set, avg O(1) lookup |
unordered_multimap |
std::unordered_multimap<K,V> |
Hash map with duplicate keys |
unordered_multiset |
std::unordered_multiset<T> |
Hash set with duplicate values |
multiset |
std::multiset<T> |
Sorted set allowing duplicates |
multimap |
std::multimap<K,V> |
Sorted map allowing duplicate keys |
Expected API (Example for unordered_map)
from pythonstl import unordered_map
um = unordered_map()
um.insert("key", 42)
print(um.find("key")) # 42
print(um.count("key")) # 1
um.erase("key")
print(um.size()) # 0Checklist
-
unordered_map -
unordered_set -
unordered_multimap -
unordered_multiset -
multiset -
multimap - Unit tests for each
- Docstrings with time complexity annotations
Notes
unordered_mapandunordered_setshould be prioritized as they are the most frequently used.multisetandmultimapare natural extensions of the already existingstl_setandstl_map.
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
enhancementNew feature or requestNew feature or requesthelp wantedExtra attention is neededExtra attention is needed