10-26 notes - 10/26/11 BST(continued) Worst case 1 \ 2 \ 3...

Info iconThis preview shows pages 1–2. Sign up to view the full content.

View Full Document Right Arrow Icon
10/26/11 BST(continued) Worst case 1 \ 2 \ 3… H=θ(n) Best case 1-11 6 / \ 3 9 / \ / \ 1 5 7 11 \ / \ / 2 4 8 10 H= θ(logn) How do you improve this? Improved Structures (Balanced binary trees) AVL trees Red-Black Trees ^^^ Guarantee balance Skiplist List with forwarding pointers How pointers work o Each node of list has a key and a pillar of some height o Pillar = array of next and previous pointers o Bottom of pillar of height t is level -; top level t-1 o All pillars of height >= L+1 are linked by pointers stored at level L o Head and tail pillars have keys –inf, +inf and exist at all levels o Height of each pillar is randomly chosen, as will be specified Min: head.next(0).key θ(1) Max: tail.prev(0).key θ(1) Succ(x): x.next(0).key θ(1) Pred(x): x.prev(0).key θ(1) Remove(x): θ(node height)
Background image of page 1

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
Background image of page 2
This is the end of the preview. Sign up to access the rest of the document.

This note was uploaded on 12/05/2011 for the course ENGINEERIN 131 taught by Professor Cytron during the Spring '11 term at Washington University in St. Louis.

Page1 / 2

10-26 notes - 10/26/11 BST(continued) Worst case 1 \ 2 \ 3...

This preview shows document pages 1 - 2. Sign up to view the full document.

View Full Document Right Arrow Icon
Ask a homework question - tutors are online