time proportional to the index of in the favorite list that isif is the kth most popular element in the favorite listthen accessing it takes (ktime in many reallife access sequencesincluding those formed by the visits that users make to web pagesit is common thatonce an element is accessedit is likely to be accessed again in the near future such scenarios are said to possess locality of reference heuristicor rule of thumbthat attempts to take advantage of the locality of reference that is present in an access sequence is the move-to-front heuristic to apply this heuristiceach time we access an element we move it all the way to the front of the list our hopeof courseis that this element will then be accessed again in the near future considerfor examplea scenario in which we have elements and the following series of accesseselement is accessed times element is accessed times element is accessed times if we store the elements sorted by their access countsinserting each element the first time it is accessedthen each access to element runs in ( time each access to element runs in ( time each access to element runs in (ntime thusthe total time for performing the series of accesses is proportional to nn* ( +nn( )/ which is ( on the other handif we use the move-to-front heuristicinserting each element the first time it is accessedthen each access to element takes ( time each access to element takes ( time each access to element runs in ( time