notes16b

75 how do we determine a good ordering approach 1 move

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: the items in the list • Example: List of four students S1, S2, S3, S4 Probability of retrieval: S1 ß། 5% S2 ß། 15% S3 ß། 30% S4 ß། 50% Texp = 1* 5/100 + 2*15/100 + 3*30/100 + 4*50/100 = 3.25 Reverse the list à༎ Texp = 1* 50/100 + 2*30/100 + 3*15/100 + 4*5/100 = 1.75 How do we determine a good ordering Approach 1: (“move forward”) - Maintain a count with each item, initially 0 - Update count when item is retrieved July 2nd, 2013 - allow the retrieved item to ‘move forward’ if its count warrants pros: - data is in optimal order eventually à༎ takes time cons: - takes more memory to store count Example: Suppose incidents are as follows: S3, S2, S3, S4, S4, S4,...
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