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
Andre is teaching a class without the software development cycle while teaching the analyst phase which task should Andre mentio
Delvig [45]

I have no idea sorry

7 0
3 years ago
A counter is a tool used to measure the number of times people visit a Web site. true or false?
Liono4ka [1.6K]

True.

It doesn't measure unique users, so you can just hit refresh and the counter keeps going up...

5 0
4 years ago
Pedro is at a conference for computer programmers and wants to attend a session on new features in software that help write code
Natasha_Volkova [10]

Answer:

1) Variable Management for Beginers

6 0
3 years ago
Python
ladessa [460]

def is_list_even(my_list):

   for i in my_list:

       if(i%2 != 0):

           return False

   

   return True

   

   

def is_list_odd(my_list):

   for i in my_list:

       if(i%2 == 0):

           return False

   

   return True

   

def main():

   n = int(input())

   lst = []

   

   for i in range(n):

       lst.append(int(input()))

   

   if(is_list_even(lst)):

       print('all even')

   

   elif(is_list_odd(lst)):

       print('all odd')

   

   else:

       print('not even or odd')

       

       

if __name__ == '__main__':

   main()

8 0
2 years ago
Why is a specific naming convention important in regards to your file management system
Montano1993 [528]
Because it keeps your files, folders, and documents in a consistant logical way
7 0
3 years ago
Other questions:
  • In order to accomplish the same goal, a person can click and hold down the mouse button and drag to the right, or hold Shift and
    10·1 answer
  • How is gawain tempted​
    9·1 answer
  • 1. The best program to present numerical data in would be ____. a. Access c. PowerPoint b. Excel d. Word
    6·1 answer
  • Write an expression that evaluates to true if and only if the string variable s does not equal the string literal end.
    5·1 answer
  • Which of the following best describes a situation where software should be upgraded instead of replaced?
    6·1 answer
  • Ventaja que implica usar funciones en las hojas de calculo
    12·1 answer
  • Based on the information in the table, which of the following tasks is likely to take the longest amount of time when scaled up
    14·1 answer
  • What is the output for the following code?<br><br> print (5*4+5)
    11·1 answer
  • A. Modify the FitnessTracker class that includes data fields for a fitness activity, the number of minutes spent participating,
    12·1 answer
  • _____ regulate current/voltage flow, similar function as _____,but are smaller, cheaper, and more reliable.
    9·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!