Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Question 2) (a) Write a (C++/Java) program that checks if a number is Palindrome (use a recursive function as you code). A palindrome number is

Question 2) (a) Write a (C++/Java) program that checks if a number is Palindrome (use a recursive function as you code). A palindrome number is a number that reads the same from beginning to end and from end to beginning, in other words, a palindrome number remains the same when its digits are reversed. For example, 13431 is a palindrome number. 2332 is another one. (Note: Your program should receive an integer number as the input and always work with integer types, i.e., you cannot use string or char types throughout your code. You cannot convert the input to a string.) No points for the non-recursive function. Paste your code in the solution file and describe it. (b) Analyze your codes time complexity in the worst case. Show all your work. You may assume the number given to your function has n digits. (c) test cases: You need to run your code for the following test cases and show the result obtained by the program. A screenshot of each run should be added to your solution. 1) 2 (output: yes) 2) 1234321 (output: yes) 3) 12341234 (output: no) 4) 7667 (output: yes) 5) -121 (output: yes) 6) -455 (output: no)

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 Technology And Management Computers And Information Processing Systems For Business

Authors: Robert C. Goldstein

1st Edition

0471887374, 978-0471887379

More Books

Students also viewed these Databases questions

Question

1. What steps might you include or remove from this process?

Answered: 1 week ago

Question

What about leadership lessons from particularly good or bad bosses?

Answered: 1 week ago