This project provides an implementation of LFU (Least Frequently Used) cache and
Belady’s optimal cache algorithm in C++. It includes:
- An implementation of the LFU cache
- An implementation of Belady’s optimal cache algorithm
- Python scripts for automated testing and comparison
Clone this repository, then reach the project directory:
git clone https://github.com/bgclutch/Cache_Task_cpp.git
cd Cache_Task_cpp- Build the project:
cmake -B build
cmake --build build- Navigate to the
buildfolder:
cd build- Choose cache to run:
./lfu/lfuor
./belady/beladyFor End To End tests:
1.1 Navigate to the tests directory:
cd tests/EndToEnd1.2 Run default tests with the Python script:
python3 testrun.py1.3 (Optional) Or regenerate test cases:
python3 testgen.pyAnd run it as in step 2.
For unit tests:
2.1 Navigate to the build folder:
cd build- Run unit tests:
./tests/tests