Positive no need to maintain count positive

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: S4 Head S3 0 S4 0 Ÿ༉ S2 0 S1 0 Head S2 0 S4 0 Ÿ༉ S1 0 S3 1 Head S4 0 Ÿ༉ S1 0 S2 1 S3 1 Head S4 0 Ÿ༉ S1 0 S2 1 S3 2 Head S1 0 Ÿ༉ S2 1 S3 2 S4 4 Approach 2: (‘move to front’) - when an item is retrieved, we move it to the head of the list pros: - we do not need to maintain a count - although it’s not optimal, generally performs well cons: - items move quickly to the front Approach 3: (swap) • When an item is retrieved, swap it with the item before it positive à༎ no need to maintain count positive à༎ frequently accessed items slowly move to...
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