We have already seen the problem to reverse the words in a string, in the solution to that problem we have also written function to reverse the string. That was a non-recursive (iterative) function. Write a recursive function to reverse the String. For example: If the String is “ABCD” then the output should be “DCBA“. Before […]
Given a String, reverse the string but do not reverse the words. For example, if Input : “MCN Professionals is now Ritambhara” Output: “Ritambhara now is Professionals MCN” Your function should not take more that O(n) time in the worst case.
Given two strings, write code to print all inter-leavings of these strings. For example: if the two strings are “AB” and “12”, then the output should be: AB12 A1B2 A12B 1AB2 1A2B 12AB Note that the order of characters in the individual strings are not changed in the output.