如何用 C 语言实现紧凑有向无环字图 (CDAWG)?

发布于 2024-07-15 22:58:51 字数 1435 浏览 6 评论 0原文

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

叹沉浮 2024-07-22 22:58:51

从我可以看到这篇论文

这是一个trie 使用后缀压缩来减少匹配的最终状态变化,因为我曾经做过类似的事情,所以我也考虑过这样做以节省空间。 这是我想到的数据结构的解决方案,我有兴趣看看是否还有其他方法:

struct cdawg
{
    int issuffix:1;
    int length:31;
    char *s; // suffix if issuffix == 1, else array of valid transition chars
    struct cdawg *trans; // array of next states based on the index of trans char in s, null if suffix
};

From what I can see from this paper

It's a trie with suffix compression to reduce the final state changes for a match, since I'd worked on something similar that, I had also considered doing that to save space. This was the solution I had thought of for the data structure, I'm interested to see if there are other approaches:

struct cdawg
{
    int issuffix:1;
    int length:31;
    char *s; // suffix if issuffix == 1, else array of valid transition chars
    struct cdawg *trans; // array of next states based on the index of trans char in s, null if suffix
};
~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文