DSA-Assignments

Log | Files | Refs | README

commit b18d2dc2ca5824cac06486b12ed3318d106cfe70
parent 72a9aba8ce40730fa7d93e2944b95a939b6d235b
Author: TranLili <tranlili96@gmail.com>
Date:   Thu, 30 Nov 2023 14:41:03 +0100

Add inclusion for unorderd map.

Diffstat:
MProblem4/Problem4.cpp | 3++-
1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/Problem4/Problem4.cpp b/Problem4/Problem4.cpp @@ -7,6 +7,7 @@ #include <iostream> #include <cmath> +#include <unordered_map> using namespace std; @@ -24,7 +25,7 @@ int T(int n) { return 1; } - // Recursive case: calculate T(n-1) and T(ceil(n/2)) if not already done + // Calculate T(n-1) and T(ceil(n/2)) if not already done int result = T(n - 1) + T(std::ceil(n / 2.0)) + n; // Store the result in the map before returning