From 850a381bff00eacd9c48261297094a47eabd37a7 Mon Sep 17 00:00:00 2001 From: Jidong Xiao Date: Fri, 2 Feb 2024 13:43:02 -0500 Subject: [PATCH] adding recursion review question --- lectures/08_vector_implementation/README.md | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/lectures/08_vector_implementation/README.md b/lectures/08_vector_implementation/README.md index cce795b..67c3811 100644 --- a/lectures/08_vector_implementation/README.md +++ b/lectures/08_vector_implementation/README.md @@ -8,6 +8,17 @@ - Templated classes (including compilation and instantiation of templated classes) - Copy constructors, assignment operators, and destructors +## Recursion Review + +What is the value of fun(2)? + +```cpp +int fun(int n) { +if (n == 4) return n; +else return 2*fun(n+1); +} +``` + ## 8.1 Vector Public Interface In creating our own version of the STL vector class, we will start by considering the public interface: