This repository contains Python and C++ code implementations for the algorithms discussed in the book "Grokking Algorithms" by Aditya Bhargava.
Each chapter of the book corresponds to a Python file in this repository. The naming convention follows the pattern chapter X.py
, where X
represents the chapter number.
To run the code in this repository, you'll need Python installed on your system. The code is written in Python 3.
- Clone the repository to your local machine:
git clone git@github.com:mohamedhassan218/grokking-algorithms.git
-
Navigate to the Python directory:
cd "Grokking Algorithms in Python"
-
Run the Python files corresponding to the chapters you're interested in:
python chapter1.py
-
Navigate to the C++ directory:
cd "Grokking Algorithms in C++"
-
Compile and run the C++ files corresponding to the chapters you're interested in. For example:
g++ chapter1.cpp -o chapter1 ./chapter1
Contributions to this repository are welcome. If you find any bugs or want to improve the existing code, feel free to submit a pull request.
Special thanks to Aditya Bhargava for writing Grokking Algorithms and making the concepts accessible through practical examples. I really benefited a lot from this book and it was a good start for me towards the basic computer science principles.