Question
The following function is supposed to check whether or not the substring of an input string str beginning from an input index start and ending
The following function is supposed to check whether or not the substring of an input string str beginning from an input index start and ending at an input index end is a palindrome. For example, if the parameters are (INANC, 0, 4), the function returns false because INANC!=CNANI; but if the parameters are (INANC, 1, 3), the function returns true because the substring between index 1 and index 3 of INANC is NAN and it is a palindrome (it reads the same from left to right and from right to left.). b
boolean IsPalindrom(string str, int start, int end) { if (str[start]==str[end]) return IsPalindrom(str, start+1, end-1); else return false; }
This function is missing an important part. How should we complete it?
Step 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