notes16b

npn lets say all the probabilities are the same pk

Info iconThis preview shows page 1. Sign up to view the full content.

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

Unformatted text preview: . + Pn ≤ 1 ! !! Pk ≤ 1 • In a linked list, to retrieve a value at position k, takes k steps Texp = 1*P1 + 2*P2 + ... + n*Pn • Lets say all the probabilities are the same Pk = 1/n Texp = (1+2+3+...+n)/n = (n+1)/2 ß།average time for retrieving a value If the probabilities are not equal, to minimize Texp, P1 ≥ P2 ≥ P3 ≥ ... ≥ Pn o We may need to reorder...
View Full Document

This note was uploaded on 02/04/2014 for the course CS 234 taught by Professor Baranoski during the Spring '09 term at Waterloo.

Ask a homework question - tutors are online