代码之家  ›  专栏  ›  技术社区  ›  andreasw

如何在C语言中实现紧凑的有向无环字图(CDAWG)?[关闭]

  •  4
  • andreasw  · 技术社区  · 16 年前

    如何实施 this data structure 在C?它是一种类似于DAWG的结构,但空间效率是DAWG的两倍,这比只压缩前缀的trie更有效。

    1 回复  |  直到 10 年前
        1
  •  5
  •   sfossen    16 年前

    从这里我可以看到 paper

    它是一个带有后缀压缩的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
    };