1answer.
Ask question
Login Signup
Ask question
All categories
  • English
  • Mathematics
  • Social Studies
  • Business
  • History
  • Health
  • Geography
  • Biology
  • Physics
  • Chemistry
  • Computers and Technology
  • Arts
  • World Languages
  • Spanish
  • French
  • German
  • Advanced Placement (AP)
  • SAT
  • Medicine
  • Law
  • Engineering
Eduardwww [97]
4 years ago
13

A palindrome is a string that reads the same both forward and backward. For example, the string "madam" is a palindrome. Write a

program that uses a recursive function to check whether a string is a palindrome. Your program must contain a value-returning recursive function that returns true if the string is a palindrome and false otherwise. Do not use any global variables; use the appropriate parameters.
Computers and Technology
1 answer:
MatroZZZ [7]4 years ago
8 0

// this function will return 1 if the string sent in arguments is palindrome //else it will return 0

int palindrome(int start_of_string, int end_of_string, string &strr)

{

// base case to check if the string is not empty

if (start_of_string>= end_of_string)

   return 1;

if (strr[start_of_string] != strr[end_of_string])

    return 0;

// recursive call

return palindrome(++start_of_string, --end_of_string, strr);    

}

You might be interested in
Zack is working on an assignment at school. He wants to save his work so he can take it home and complete it on his home compute
ser-zykov [4K]

Answer:

USB DRIVE

Explanation:

If I was zack i would use a usb drive, since it is portable and small and would fit his school work

3 0
3 years ago
Three materials needed to stream video video content
PIT_PIT [208]
Oh yeah yeah I don’t know ‍♂️ is
8 0
3 years ago
Read 2 more answers
Kevin is a DJ and has a passion for creating and modifying audio tracks. Which application software facilitates him in his passi
stiv31 [10]
B. Multimedia software
5 0
3 years ago
Within an event-driven program a component from which an event is generated is the ____
mojhsa [17]
The answer is: <span>Source of the Event</span>
7 0
4 years ago
Carina is concerned that her computer is slowing down because it doesn’t have enough short-term memory. Which of the following s
steposvetlana [31]
I would say I think RAM? Hope this helps;)
8 0
3 years ago
Read 2 more answers
Other questions:
  • Use the following business rules to assign name to the tables on the ERD: Note: These rules are in the context of a small retail
    7·1 answer
  • Which best describes a VPN?
    14·2 answers
  • For each of the following data storage needs, describe which abstract data types you would suggest using. Natural choices would
    15·1 answer
  • Consider the following relationship involving two entities, students and classes:A student can take many classes. A class can be
    9·1 answer
  • PLEASE HELP!!!!!!!!!!!!!!!!!!!!
    13·1 answer
  • What are some pros for having your phone during school hours?
    10·2 answers
  • Define the missing method. use "this" to distinguish the local member from the parameter name.
    11·2 answers
  • Which tab of the ribbon should you go to for removing gridlines on a worksheet?​
    14·1 answer
  • In cell K8, create a formula using the SUM function that calculates the total of the range D17:D20 and subtracts it from the val
    6·1 answer
  • What is an accessor in Java?
    12·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!