{[ promptMessage ]}

Bookmark it

{[ promptMessage ]}

14-Competitive-Analysis

# 14-Competitive-Analysis - Algorithms LECTURE 14 Competitive...

This preview shows pages 1–9. Sign up to view the full content.

Algorithms L14.1 Professor Ashok Subramanian L ECTURE 14 Competitive Analysis Self-organizing lists Move-to-front heuristic Competitive analysis of MTF Algorithms

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

View Full Document
Algorithms L14.2 Self-organizing lists List L of n elements The operation A CCESS ( x ) costs rank ( x ) = distance of x from the head of L . L can be reordered by transposing adjacent
Algorithms L14.3 Self-organizing lists List L of n elements The operation A CCESS ( x ) costs rank ( x ) = distance of x from the head of L . L can be reordered by transposing adjacent 12 3 50 14 17 4 L Example:

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

View Full Document
Algorithms L14.4 Self-organizing lists List L of n elements The operation A CCESS ( x ) costs rank ( x ) = distance of x from the head of L . L can be reordered by transposing adjacent 12 3 50 14 17 4 L Accessing the element with key 14 costs 4 . Example:
Algorithms L14.5 Self-organizing lists List L of n elements The operation A CCESS ( x ) costs rank ( x ) = distance of x from the head of L . L can be reordered by transposing adjacent 12 3 50 14 17 4 L Transposing 3 and 50 costs 1 . Example: 3 50

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

View Full Document
Algorithms L14.6 On-line and off-line problems Definition. A sequence S of operations is provided one at a time. For each operation, an on-line algorithm A must execute the operation immediately without any knowledge of future operations (e.g., Tetris ). An off-line algorithm may see the whole sequence S in advance. Goal: Minimize the total cost C ( S ) . The game of Tetris
Algorithms L14.7 Worst-case analysis of self- organizing lists An adversary always accesses the tail ( n th) element of L . Then, for any on-line algorithm A , we have C ( S ) = (| S | n )

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

View Full Document
Algorithms L14.8 Average-case analysis of self- organizing lists Suppose that element x is accessed with probability p ( x ) . Then, we have = L x L A x x p S C ) ( rank ) ( )] ( [ E , which is minimized when L is sorted in
This is the end of the preview. Sign up to access the rest of the document.

{[ snackBarMessage ]}

### Page1 / 40

14-Competitive-Analysis - Algorithms LECTURE 14 Competitive...

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

View Full Document
Ask a homework question - tutors are online