Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Write a recursive function named isPalindrome that accepts a string parameter and returns true if the string is the same forwards as backwards, ignoring capitalization.

Write a recursive function named isPalindrome that accepts a string parameter and returns true if the string is the same forwards as backwards, ignoring capitalization. For example, the call of isPalindrome("Madam") should return true.

I only get 9/13 correct and am unsure as to why.

image text in transcribedimage text in transcribed

write a recursive function named isPalindrome that accepts a string parameter and returns true if the string is the same forwards as backwards, ignoring capitalization. For example, the call of isPalindrome ("Madam") should return true. Constraints: Do not declare any global variables or any auxiliary data structures. Do not use any loops; you must use recursion. Type your solution here: 1 bool is Palindrome (string str) 3 if (str. length() str length 1) return true return isPalindrome (str.substr C1, str length 1)) 8 else if (str.at (0) str.at (1)) return true; 10 else if (str.at (0) E str.at (str. length() 1)) return true 12 return isPalindrome (str.substr C1, str length 1)) 13 14 15 16 17 else return false; 18 19

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Database Security

Authors: Alfred Basta, Melissa Zgola

1st Edition

1435453905, 978-1435453906

More Books

Students also viewed these Databases questions

Question

Describe the factors influencing of performance appraisal.

Answered: 1 week ago

Question

What is quality of work life ?

Answered: 1 week ago

Question

How do Excel Pivot Tables handle data from non OLAP databases?

Answered: 1 week ago