Answered step by step
Verified Expert Solution
Question
1 Approved Answer
Using C++, please write the code for the project below. Also, please describe the experiments and results findings. Thanks! In this project we will write
Using C++, please write the code for the project below. Also, please describe the experiments and results findings. Thanks!
In this project we will write two recursive methods and two iterative methods to solve two problems. The first problem is the sum of squares. Your methods to solve this problem should have one parameter called k of type int. It should return the sum of the squares of the numbers up to and including k (i.e. it should return 1*1 +2*2 + ... +k*k). The second problem is checking if a string is a palindrome. It should have one parameter called str of type String. It should return true if the string is palindrome or false otherwise. For example: Was it a car or a cat I saw? >>>>>>>A palindrome A toy for a jar of tuna. >>>>>>>>Not a palindrome Compare the running time of each different implementation of these methods and report your finding based on your observations. Use more data gradually and report if you see differences in the running time by timing your methods executions. You can use a table as follows: Experiment Palindrome String Size Iterative Palindrome ecursive Palindrome True FalseStep by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started