You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Weighted Random Sampling: Sampling items with proportional probability to their weight.
Efficiency: O(log(n)) time and O(1) space per sample, making this class suitable for performance-demanding applications where the set of items is large and the sampling frequency is high.
Comprehensive documentation: The class is thoroughly documented, enabling IDEs to provide helpful tooltips that enhance the coding experience.
Tests: Fully covered by unit tests.
No external runtime dependencies: Only development dependencies are used.
ES2020 Compatibility: The tsconfig target is set to ES2020, ensuring compatibility with ES2020 environments.