10-31 notes - except perhaps the last o Indeed if a search...

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

View Full Document Right Arrow Icon
10/31/11 SkipList: Cost of Operations Let H be height of tallest pillar in skiplist of size n. o (worst case to delete is θ(H)) Goal: argue that E(H)=O(logn) Will show: find inspects θ(1) pillars at each level of skip list Let h j be height of jth node’s pillar Pr(h j = t) = (1/2) t Pr(h j >t)? == (1/2) t o =Sum from j=t+1 to inf of (1/2) j o =(1/2) t+1 sum from 0 to inf of (1/2) j o =(1/2) t+1 * 2 o ==(1/2) t Pr(H>t) = o Pr(h 1 >t or h 2 >t or… or h n >t) [BUT CAN’T INCLUDE INTERSECTION TWICE] o Case of n=2 Pr(h 1 >t)+Pr(h 2 >t)-Pr(h 1 >t AND h 2 >t) o Bonferroni Corrections You can get an approximation to the right value Sum from i=1 to n of Pr(h i >t) = n(1/2) t What is E(H)? o Claim: E(H) = O(logn) o Expected time to delete is O(logn) E(Cost of find) = sum (levels (l) of list) of E(cost of find steps @ level l) o Claim: For each level l E(#steps at level l) = 3 o Cor: E(cost of find) = 3O(logn) = O(logn) o Obs: Every node checked by search at level l has pillar with max level =l,
Background image of page 1

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

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

Unformatted text preview: except perhaps the last o Indeed, if a search passes a pillar at level l, it would have passed it at a higher level, so would not have returned to t at level l o Each pillar w/ max level >= l has max level exactly l w/ probability Pr(Max level = l | max level >= l) = ½ (1/2) l+1 /(1/2) l o Chance that j pillars in a row of max level >= l are at max level exactly =(1/2) j Define Y = # pillars in a row that reach level l but fail to reach level l+1 E(Y) = sum from j=0 to inf of j*(1/2) j == (1/2)/(1-(1/2)) 2 = 2 o Conclude: at level l, we pass an average of 2 pillars of height = l+1 before seeing a pillar of height >l+1, which causes us to stop and go down to the next level o Therefore, expected number of pillars inspected at level l is 2+1 = 3 o...
View Full Document

{[ snackBarMessage ]}

Page1 / 2

10-31 notes - except perhaps the last o Indeed if a search...

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