logo

Palindrome and Anagram Pseudo Code

   

Added on  2019-09-22

3 Pages323 Words666 Views
 | 
 | 
 | 
Pseudo Code of Palindromestart -> pointer to traverse string from beginningend -> pointer to traverse string from end.function boolPalindrome(string,start,end):if (length of string < 1)return Trueelse:if string[start] == string[end]:return boolPalindrome(string,start+1,end-1)else:return FalseImplementation of Algorithm in Code1.According to the algorithm first the length of string is checked whether it is less than 1 or not.2.After that first and last index of string are compared.3.If they are similar then continue comparing the indexes until there is only 1 or 0 index leftto compare.4.If any of the indexes are not similar then string is not a palindrome
Palindrome and Anagram Pseudo Code_1

End of preview

Want to access all the pages? Upload your documents or become a member.

Related Documents