• Share
  • Email
  • Embed
  • Like
  • Save
  • Private Content
Trie树分享
 

Trie树分享

on

  • 1,720 views

Trie树分享

Trie树分享

Statistics

Views

Total Views
1,720
Views on SlideShare
1,043
Embed Views
677

Actions

Likes
0
Downloads
4
Comments
0

2 Embeds 677

http://qa.alibaba.com 675
http://feed.feedsky.com 2

Accessibility

Upload Details

Uploaded via as Microsoft PowerPoint

Usage Rights

© All Rights Reserved

Report content

Flagged as inappropriate Flag as inappropriate
Flag as inappropriate

Select your reason for flagging this presentation as inappropriate.

Cancel
  • Full Name Full Name Comment goes here.
    Are you sure you want to
    Your message goes here
    Processing…
Post Comment
Edit your comment

    Trie树分享 Trie树分享 Presentation Transcript

    • Trie树
    • Outline
      何为Trie树
      双数组Trie树
      中文搜索算法中的XTrie
      Xtrie的数据构造与测试
    • 何为Retrieval树
    • 何为Trie树
      B, B- , B+, B*
      Hash
      Trie
      加法hash
    • 双数组Trie
      为什么要使用双数组Trie
      状态机
    • 双数组Trie—Structure&Walking
    • 双数组Trie—Construction
    • 双数组Trie—Suffix Compression
    • 双数组Trie—Key Insertion
      When the branching point is in the double-array structure
      When the branching point is in the tail pool
    • 双数组Trie—Key Deletion
      Delete k = a1a2...ah-1ah...an, a1a2...ah-1是在双数组结构中,且ah...an在tail pool中
    • 双数组Trie—example
      bachelor
      jar
      badge
      baby
    • 搜索算法中的XTrie
      class Dict
      class DoubleArrayTrie
      class DADLTrie (Double Array Double Linkedlist) (充分利用空闲单元,而使用了双向链表)
      class DoubleTrie (双向Trie)
      class Xtrie
      m_pTrie = new b2bmlr::DoubleTrie();
      m_pTrie->add((b2bmlr::DictKeyT*)pKey, nKeyLen, m_nDateSize + 1);
      intnOffset = m_pTrie->match((b2bmlr::DictKeyT*)pKey, nKeyLen);
    • 中文搜索算法中的XTrie
      参考Trie.cpp
      深度优先搜索
    • Xtrie的数据构造与测试
    • Xtrie的数据构造与测试
    • Xtrie的数据构造与测试
    • Xtrie的数据构造与测试
      bed
      beg
      baby
      book
      edit
      beld
      bold
      插入重复的key
      插入超长的key
      插入超大数据量的key
      ……
      针对数据结构的测试:
      • 了解数据结构本身
      • 了解数据结构的相应算法
      • 数据结构覆盖
      • 算法路径覆盖
    • 参考文献
      An Implementation of Double-Array Trie
      [Aoe1989] Aoe, J. An Efficient Digital Search Algorithm by Using a Double-Array Structure. IEEE Transactions on Software Engineering. Vol. 15, 9 (Sep 1989). pp. 1066-1077.
    • Q&A