This project serves as a learning exercise to explore data structures and algorithms in Python and C languages, using problems from HackerRank and LeetCode.
The project is divided into two main parts: Python and C. Each part focuses on implementing solutions to various algorithmic challenges.
-
Create a Virtual Environment:
First, initialize the virtual environment:
python -m venv .venv
-
Activate the Virtual Environment:
Activate the virtual environment:
.venv\Scripts\activate
-
Install Dependencies:
Install required dependencies using pip:
py -m pip install -r requirements.txt
To run the test cases for the Python part, use the following command at the root directory:
pytest -v -s tests_hr
This command executes pytest with verbose output (-v) and shows stdout output (-s).
-
Install Makefile on Windows: First install the Makefile for Windows from the following link: Makefile for Windows and add the bin directory to the system path.
Later on you can check the version of MingW installed by running the following command:
mingw-get --version
Now we can proceed with the installation of the make utility:
mingw-get install make
Then, in the bin directory we rename the make executable with
make.exe
. Finally you can check the version of make installed by running the following command:make --version
-
Install GCC Compiler:
Ensure that you have the GCC compiler installed on your system.
-
Compile C Programs:
Compile your C code (replace main.c with your actual C source file if different):
gcc main.c -o main main
This command compiles the C source file main.c and creates an executable named main. The second command runs the compiled program.