TE
科技回声
首页24小时热榜最新最佳问答展示工作
GitHubTwitter
首页

科技回声

基于 Next.js 构建的科技新闻平台,提供全球科技新闻和讨论内容。

GitHubTwitter

首页

首页最新最佳问答展示工作

资源链接

HackerNews API原版 HackerNewsNext.js

© 2025 科技回声. 版权所有。

Data Structure for Dynamic Discrete Probability Distributions

1 点作者 jlrubin26 天前

1 comment

jlrubin26 天前
Options like std::discrete_distribution don&#x27;t allow updates, in Rust e.g. <a href="https:&#x2F;&#x2F;docs.rs&#x2F;rand_distr&#x2F;latest&#x2F;rand_distr&#x2F;weighted&#x2F;struct.WeightedTreeIndex.html" rel="nofollow">https:&#x2F;&#x2F;docs.rs&#x2F;rand_distr&#x2F;latest&#x2F;rand_distr&#x2F;weighted&#x2F;struct...</a> allows updates but sampling is O(log n) and updating is also O(log n).<p>This neat data structure has a great set of tradeoffs.