Question: Analysis of Algorithms Java Question 2) (a) Write a ( C++/ Java) program that checks if a number is Palindrome (use a recursive function as
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 code's 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: no) 5) -121 (output: yes) 6) -455 (output: no)
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
