Problem statement is here.
For the first requests, all the sectors are cached. For every request , we have sectors to put in cache location. To discard one of the sectors, we can give weight to every sector which is equal to the difference between the index of next request for that sector and the index of the current request. So if the next request for sector is appearing at index then the weight of that sector is . Choose the sectors with the minimum weight.
For the first requests, all the sectors are cached. For every request , we have sectors to put in cache location. To discard one of the sectors, we can give weight to every sector which is equal to the difference between the index of next request for that sector and the index of the current request. So if the next request for sector is appearing at index then the weight of that sector is . Choose the sectors with the minimum weight.