From d0d30f4bdda685c0187e6688d09e82ba8552cee6 Mon Sep 17 00:00:00 2001 From: Bryne Carruthers <63172116+DrCBeatz@users.noreply.github.com> Date: Wed, 13 Mar 2024 16:52:10 -0400 Subject: [PATCH] Update README.md --- README.md | 70 ++++++++++++++++++++++++++++++++++++++++++++++++++++++- 1 file changed, 69 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index 54c9fb0..15678e1 100644 --- a/README.md +++ b/README.md @@ -1 +1,69 @@ -# master-theorem +# Master Theorem Evaluation Web App + +This web application allows users to evaluate recursive divide and conquer algorithms using the Master Theorem and determine their time complexity, providing valuable insights into algorithm performance. + +Algorithms with the following recurrence relation (known as the Master Recurrence) can be evaluated using the Master Theorem: + +`T(n) = aT(n/b) + f(n)` + +where a > 0 and b > 1 + +- a = the number of recursive subproblems +- b = the factor by which the problem size is reduced +- k = the exponent of the work outside the recursion + +## Features + +- Evaluate the time complexity of divide and conquer algorithms. +- Visualization of algorithm performance. +- Comparison between different algorithms through preset options. +- Python code and description of preset algorithms. + +## How to use the app: + +1. Enter your own values for a, b, and k in the respective input fields. +2. Ensure the 'User Input' option is selected under 'Algorithm Presets'. +3. Click the 'Evaluate' button to see the results. + +Try the following sample inputs: + +- a = 4, b = 2, k = 1 +- a = 4, b = 2, k = 2 +- a = 4, b = 2, k = 3 + +You can also choose from various preset algorithms (e.g., binary search or merge sort) by clicking one of these options, then click 'Evaluate'. You'll be able to see sample code and a description of the algorithm below the evaluation. + +## How to install locally + +### Installation requirements: +- Docker CLI +- NPM + +At the command line/terminal, type the following commands. +```bash +git clone https://github.com/drcbeatz/master-theorem.git + +cd master-theorem + +docker compose build + +docker compose up -d + +cd frontend + +npm install + +npm run dev +``` + +(then click on the link to view the React front end in your web browser). + +You can also run tests in the root directory with the following command: + +```bash +docker compose exec web pytest +``` + +## References + +- Cormen, T. H., Leiserson, C. E., Rivest, R. L., & Stein, C. (2022). *Introduction to Algorithms* (4th ed.). MIT Press.