Question: I require some help performing this task for an assignment. It is required that I utilize a basic brute force algorithm which is to be

I require some help performing this task for an assignment. It is required that I utilize a basic brute force algorithm which is to be performed in C++
If you can write comments to explain the code that would be much appreciated. Thank you in advance.
Problem 2: Calculating S(n) Consider the sequence S(n), defined as follows: 0 If n = 0 S(n) 1 If n=1 S(O) = 0 S(10) = 55 s(1) = 1 S(11) = 89 (2) = 1 S(12) = 144 S(3) = 2 S(13) = 233 S(4) = 3 S(14) = 377 S(5) = 5 S(15) = 610 S(6) = 8 S(16) = 987 S(7) = 13 S(17) = 1597 S(8) = 21 S(18) = 2584 S(9) = 34 S(19) = 4181 The first 20 terms of the sequence S(n-1) + S(n - 2) If n > 1 Example: S(4) = S(3) + S(2) = S(2) + S(1) + S(1) + S(0) = S(1) + S(0) +1+1+0 = 1 + 0 + 1 + 1 + 0 = 3 A direct (brute force) implementation of the definition of Sn results in a very slow and inefficient algorithm (exponential time). Task 1 In a new CPP file called task_1.cpp", write 1. A function int s_ver_1(int n) that implements the brute force (using basic definition) method of calculating S(n). 2. A main function that tests s_ver_1 by printing the first 15 terms of S(n) like so S
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
