This is my OS course project.
This repository contains an implementation of three popular page replacement algorithms: First-In-First-Out (FIFO), Least Recently Used (LRU), and Second Chance. These algorithms are commonly used in operating systems to manage memory allocation and ensure that the most frequently accessed pages are kept in memory, while less frequently used pages are swapped out to disk.
The code is written in a modular and extensible way, allowing for easy integration into existing systems or for use as a standalone library. Each algorithm is implemented as a separate class, with a consistent interface that allows for easy swapping between them.
The FIFO algorithm simply replaces the oldest page in memory when a new page needs to be loaded. LRU keeps track of the least recently used pages and replaces the one that has not been accessed for the longest time. Second Chance is similar to FIFO, but gives each page a "second chance" before being replaced if it has been accessed recently.