mortonnex
V2EX  ›  问与答

平衡树还是跳表?

  •  
  •   mortonnex · Feb 18, 2019 · 1535 views
    This topic created in 2822 days ago, the information mentioned may be changed or developed.
    从插入性能和查找性能来讲,跳表都更出色

    所以怎么取舍?
    1 replies  •  2019-02-18 19:56:10 +08:00
    rayingecho
    rayingecho
    Feb 18, 2019❤️2
    1
    平衡树的最差查找时间是有保证的, 一定是 O(LogN)
    跳表每层的的链表是随机生成的, 最差查找时间不稳定, 只能说平均是 O(LogN), 但最差是可以 O(N) 的
    但跳表插入更快且对并发更友好, 平衡树需要旋转, overhead 比较大
    About   ·   Help   ·   Advertise   ·   Blog   ·   API   ·   FAQ   ·   Privacy   ·   Solana   ·   4852 Online   Highest 6679   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 20ms · UTC 02:31 · PVG 10:31 · LAX 18:31 · JFK 21:31
    ♥ Do have faith in what you're doing.