@@ -34,7 +34,31 @@ TODO: Faaris- please explain your approach, including a code sample
3434
3535### Run a Benchmark
3636
37- TODO: Hank- please explain your implementation of ` main.py ` , including a code sample
37+ The main.py file was implemented with the goal of calling the methods from approach.py and
38+ analyze.py with a Typer interface for the command line interface and a Console for the output.
39+ A main function is then defined which allows for user inputs that define the quantity
40+ (number of Fibonacci numbers computed) and the method used (Iterative, recursive, or
41+ memoization). The Timeit module is imported to allow for the console to include the
42+ time the methods ran for in the output. Finally, the run times are printed out in
43+ a table for comparison between different fibonacci numbers and approaches.
44+
45+ ``` python
46+ if approach == GenerationApproach.ITERATIVE :
47+ execution_times = timeit.Timer(
48+ f " fibonacci_iterative( { quantity} ) " ,
49+ setup = " from fibonacci.iterative import fibonacci_iterative" ,
50+ ).repeat(repeat = repeats, number = runs)
51+ elif approach == GenerationApproach.RECURSIVE :
52+ execution_times = timeit.Timer(
53+ f " fibonacci_recursive( { quantity} ) " ,
54+ setup = " from fibonacci.recursive import fibonacci_recursive" ,
55+ ).repeat(repeat = repeats, number = runs)
56+ elif approach == GenerationApproach.MEMOIZATION :
57+ execution_times = timeit.Timer(
58+ f " fibonacci_memoization( { quantity} ) " ,
59+ setup = " from fibonacci.memoization import fibonacci_memoization" ,
60+ ).repeat(repeat = repeats, number = runs)
61+ ```
3862
3963### Capture Results
4064
@@ -126,7 +150,9 @@ TODO: Titus to complete
126150
127151# Next Steps
128152
129- TODO: Hank to complete
153+ Potential next steps for our understanding of the most efficent method of
154+ finding fibonacci numbers could include incorporating additional methods or
155+ finding the smallest/largest quantity that can be utilized with said methods.
130156
131157# References
132158
0 commit comments