«
class documentation

class FavoritesListMTF(FavoritesList):

View In Hierarchy

List of elements ordered with move-to-front heuristic.

Method top Generate sequence of top k elements in terms of access count.
Method _move_up Move accessed item at Position p to front of list.

Inherited from FavoritesList:

Method __init__ Create an empty list of favorites.
Method __len__ Return number of entries on favorites list.
Method __repr__ Create string representation of the favorites list.
Method access Access element e, thereby increasing its access count.
Method is_empty Return True if list is empty.
Method remove Remove element e from the list of favorites.
Class _Item Undocumented
Method _find_position Search for element e and return its Position (or None if not found).
Instance Variable _data Undocumented
def top(self, k):

Generate sequence of top k elements in terms of access count.

def _move_up(self, p):

Move accessed item at Position p to front of list.