I am trying to teach myself LRU algorithm using this youtube video. In the below example (taken from here) why is 0 replaced by 3. Shouldn’t that be 4 replaced by 3 as 4 is the least used ?

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
LRU stands for “Least Recently Used”. It’s based on taking advantage of “temporal locality” of reference, i.e. the thought that the same stuff will be used in a period of time.
In your case, the past three accesses before the current one were 0 – 4 – 2. This means that of the pages in physical memory, 0 was the least recently used, and so it gets paged out.