class documentation

List of elements ordered from most frequently accessed to least.

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.
Method top Generate sequence of top k elements in terms of access count.
Class _Item Undocumented
Method _find_position Search for element e and return its Position (or None if not found).
Method _move_up Move item at Position p earlier in the list based on access count.
Instance Variable _data Undocumented
def __init__(self):

Create an empty list of favorites.

def __len__(self):

Return number of entries on favorites list.

def __repr__(self):

Create string representation of the favorites list.

def access(self, e):

Access element e, thereby increasing its access count.

def is_empty(self):

Return True if list is empty.

def remove(self, e):

Remove element e from the list of favorites.

def top(self, k):

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

def _find_position(self, e):

Search for element e and return its Position (or None if not found).

def _move_up(self, p):

Move item at Position p earlier in the list based on access count.

_data =

Undocumented