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

科技回声

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

GitHubTwitter

首页

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

资源链接

HackerNews API原版 HackerNewsNext.js

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

Neat data structure: "Ullman" set

26 点作者 amastilovic超过 16 年前

4 条评论

fhars超过 16 年前
But AFAICT, the pop and restore operations stop working once you call del. But if your algorithm only ever adds and backtraces, you should be fine (if you know how many elements you will add or are happy to realloc your arrays from time to time, making add logarithmic).
abecedarius超过 16 年前
The "set stack" and map ideas down at the bottom suggest a variant since I was just reading about A* search: a "set priority queue" that keeps the Ullman map's parallel members and values arrays in heap order according to the values. I'm thinking this might be good for A* when the search nodes can be denoted by dense-integer keys but the distances vary over a wider range.
fauigerzigerk超过 16 年前
It seems to me the probability of a false positive membership test is non-zero.
评论 #439227 未加载
rjprins超过 16 年前
This is a rather useless data structure:<p>You can only store integers and they must be in the range of [0, n&#62;. The simple operations are O(1), because you can just map the positions of all integers based on their value in a second array of size n.
评论 #439435 未加载
评论 #439735 未加载