in this array implementation of sequencethe addfirstaddbeforeaddafterand remove methods take (ntimebecause we have to shift position objects to make room for the new position or to fill in the hole created by the removal of the old position (just as in the insert and remove methods based on indexall the other position-based methods take ( time case studythe move-to-front heuristic suppose we would like to maintain collection of elements while keeping track of the number of times each element is accessed keeping such access counts allows us to know which elements are among the "top tenmost popularfor instance examples of such scenarios include web browser that keeps track of the most popular web addresses (or urlsa user visits or photo album program that maintains list of the most popular images user views in additiona favorites list could be used in graphical user interface (guito keep track of the most popular buttons used in pull-down menuand then present the user with condensed pulldowns containing the most popular options thereforein this sectionwe consider how we can implement favorite list adtwhich supports the size(and isempty(methods as well as the followingaccess( )access the element eincrementing its access countand adding it to the favorites list if it is not already present remove( )remove element from the favorites listprovided it is already there