Think about maintaining the sequence of the last
n
accesses in addition to the list
L
itself.