Write a recursive C function to print reverse of a given string.
Given a string s1 and a string s2, write a snippet to say whether s2 is a rotation of s1 using only one call to strstr routine? (eg given s1 = ABCD and s2 = CDAB, return true, given s1 = ABCD, and s2 = ACBD , return false) Algorithm: areRotations(str1, str2) 1. Create a… Read More »
Write an efficient C function that takes two strings as arguments and removes the characters from first string which are present in second string (mask string). We strongly recommend that you click here and practice it, before moving on to the solution. Algorithm: Let first input string be”test string” and the string which has characters… Read More »
Algorithm: Let input string be “geeksforgeeks”
1: Construct character count array from the input string.
count[‘e’] = 4
count[‘g’] = 2
count[‘k’] = 2
2: Print all the indexes from the constructed array which have value greater than 0.
Below are the different methods to remove duplicates in a string.
Write an efficient C function to return maximum occurring character in the input string e.g., if input string is “test” then function should return ‘t’. We strongly recommend that you click here and practice it, before moving on to the solution. Algorithm: One obvious approach to solve this problem would be to sort the input… Read More »