Skip to content

Latest commit

 

History

History
61 lines (55 loc) · 1.07 KB

README.md

File metadata and controls

61 lines (55 loc) · 1.07 KB

LFU Cache

This project provides an implementation of LFU (Least Frequently Used) cache and
Belady’s optimal cache algorithm in C++. It includes:

  1. An implementation of the LFU cache
  2. An implementation of Belady’s optimal cache algorithm
  3. Python scripts for automated testing and comparison

Installation:

Clone this repository, then reach the project directory:

git clone https://github.com/bgclutch/Cache_Task_cpp.git
cd Cache_Task_cpp

Building:

  1. Build the project:
cmake -B build
cmake --build build

Usage:

  1. Navigate to the build folder:
cd build
  1. Choose cache to run:
./lfu/lfu

or

./belady/belady

Running tests:

For End To End tests: 1.1 Navigate to the tests directory:

cd tests/EndToEnd

1.2 Run default tests with the Python script:

python3 testrun.py

1.3 (Optional) Or regenerate test cases:

python3 testgen.py

And run it as in step 2.

For unit tests: 2.1 Navigate to the build folder:

cd build
  1. Run unit tests:
./tests/tests