InterviewSolution
Saved Bookmarks
| 1. |
In which of the following cases is the reversal of a string not equal to the original string?(a) Palindromic strings(b) Strings of length 1(c) Empty String(d) Strings of length 2The question was posed to me in unit test.This interesting question is from String Reversal using Recursion in portion Recursion of Data Structures & Algorithms II |
|
Answer» RIGHT choice is (d) Strings of length 2 Best explanation: String “ab” is a string of length 2 whose REVERSAL is not the same as the GIVEN one. PALINDROMIC Strings, String of length 1 and EMPTY Strings case – the reversal is the same as the one given. |
|