magine
V2EX  ›  问与答

存储多个 url 只做查询用,是使用平衡二叉树好还是使用字典树好?

  •  
  •   magine · Oct 1, 2014 · 3734 views
    This topic created in 4287 days ago, the information mentioned may be changed or developed.
    Supplement 1  ·  Oct 1, 2014
    写在路由器上的应用,不使用c语言以外的解决方案。
    极度重视查询效率,因为如果效率不高会出现丢包。
    9 replies    2014-10-01 18:35:59 +08:00
    Automan
        1
    Automan  
       Oct 1, 2014   ❤️ 1
    hash
    zhouquanbest
        2
    zhouquanbest  
       Oct 1, 2014
    hash+1
    daweibao
        3
    daweibao  
       Oct 1, 2014
    hash+1
    virusdefender
        4
    virusdefender  
       Oct 1, 2014
    你是多少条url,直接放数据库~
    iloahz
        5
    iloahz  
       Oct 1, 2014 via iPhone   ❤️ 1
    效率肯定字典树了,不过方便还是平衡树,直接上map。
    ls的hash也是非常靠谱的
    magine
        6
    magine  
    OP
       Oct 1, 2014
    @virusdefender
    环境需求,不能使用数据库。
    hitigon
        7
    hitigon  
       Oct 1, 2014
    字典树吧
    c742435
        8
    c742435  
       Oct 1, 2014
    多个是多少个。
    1000个和百万个还是有很大区别的
    magine
        9
    magine  
    OP
       Oct 1, 2014
    @c742435
    1000个左右。
    About   ·   Help   ·   Advertise   ·   Blog   ·   API   ·   FAQ   ·   Solana   ·   2727 Online   Highest 6679   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 48ms · UTC 12:03 · PVG 20:03 · LAX 05:03 · JFK 08:03
    ♥ Do have faith in what you're doing.