From 30bbe9cf0114b4b776d3367e8d6dc1dfb4029fd8 Mon Sep 17 00:00:00 2001 From: fdrvrtm <49094977+fdrvrtm@users.noreply.github.com> Date: Tue, 12 Nov 2019 17:19:09 +0200 Subject: [PATCH] Fix the variable typo and add the function call (#109) --- 03_recursion/c++11/02_greet.cpp | 1 + 04_quicksort/c++11/02_recursive_sum.cpp | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/03_recursion/c++11/02_greet.cpp b/03_recursion/c++11/02_greet.cpp index c743a89..9af462f 100644 --- a/03_recursion/c++11/02_greet.cpp +++ b/03_recursion/c++11/02_greet.cpp @@ -17,6 +17,7 @@ void greet(std::string name) { cout << "Hello, " + name + "!" << endl; greet2(name); cout << "Getting ready to say bye..." << endl; + bye(); } diff --git a/04_quicksort/c++11/02_recursive_sum.cpp b/04_quicksort/c++11/02_recursive_sum.cpp index b75a820..652fe0c 100644 --- a/04_quicksort/c++11/02_recursive_sum.cpp +++ b/04_quicksort/c++11/02_recursive_sum.cpp @@ -10,7 +10,7 @@ T sum(std::vector arr) { T last_num = arr.back(); // save last number value arr.pop_back(); // and remove it from array for next recursive call - return first_num + sum(arr); + return last_num + sum(arr); } int main() {