This code for bitnine intenship
- Docker
- Docker compose
-
Clone the project
git clone git@github.com:SofyanMahmoud0000/internship.git
-
Navigate the project root directory
cd internship
-
To run question_1, hit the command
sudo docker compose run question_1 sh -c "g++ -w /app/question_1.cpp -o /app/a.out && /app/a.out"
-
To run question_2, hit the command
sudo docker compose run question_2 sh -c "gcc -w /app/question_2.c -o /app/a.out && /app/a.out"
In question 2 I have used 3 methods
-
normal recursion
which is- O(2^n) Time complexity
- O(n) Space complexity
- And when you run the code you will notice that this method are very sloooow cause the time complexity is exponential
-
Top-Down Dynamic programming
usingMomization
which is- O(n) Time complexity
- O(n) Space complexity - cause of the momization and the call stack
-
Bottom-up Dynamic programming
usingIteration
which is- O(n) Time complexity
- O(1) Space complexity