Package com.zybooks.dsaj.list
Class FavoritesListMTF<E>
java.lang.Object
com.zybooks.dsaj.list.FavoritesList<E>
com.zybooks.dsaj.list.FavoritesListMTF<E>
- Type Parameters:
E
- The element type
A list of elements, ordered from most recently to least recently accessed.
-
Nested Class Summary
Nested classes/interfaces inherited from class com.zybooks.dsaj.list.FavoritesList
FavoritesList.Item<E>
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptiongetFavorites
(int k) Returns an iterable collection of the k most frequently accessed elements.static void
protected void
Moves accessed item at Position p to the front of the list.Methods inherited from class com.zybooks.dsaj.list.FavoritesList
access, count, findPosition, isEmpty, remove, size, test, toString, value
-
Constructor Details
-
FavoritesListMTF
public FavoritesListMTF()
-
-
Method Details
-
moveUp
Moves accessed item at Position p to the front of the list.- Overrides:
moveUp
in classFavoritesList<E>
-
getFavorites
Returns an iterable collection of the k most frequently accessed elements.- Overrides:
getFavorites
in classFavoritesList<E>
- Throws:
IllegalArgumentException
-
main
-