avllecture.ppt.pptVIP

  • 2
  • 0
  • 约6.97千字
  • 约 29页
  • 2016-10-06 发布于天津
  • 举报
avllecture.ppt

Problems with BST With random insertions and deletions BST has Θ ( log N ) times for search, insert and remove But worst case behaviour is Θ ( N ) Problem is that BST’s can become unbalanced We need a rebalance operation on a BST to restore the balance property and regain Θ ( log N ) Rebalancing should be cheap enough that we could do it dynamically on every insert and remove ? Preference is to have Θ ( 1 ) rebalance time Balanced Binary Search Trees If the height of a binary tree is always O(log n), we can guarantee O(log n) performance for each search tree operation Trees with a worst-case h

文档评论(0)

1亿VIP精品文档

相关文档