This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revision Previous revision
Next revision
Previous revision
cs-142:substrings-and-palindromes [2015/05/28 14:22]
cs142ta [Problem-Solving]
cs-142:substrings-and-palindromes [2015/05/28 14:23]
cs142ta [Solution]
Line 1: Line 1:
 =Substrings and Palindromes= =Substrings and Palindromes=
 ==Problem== ==Problem==
-* Write a program ​using recursion to prompt ​for an input string and then+* Write a program ​that prompts ​for an input string and then uses two recursive functions to successively
 ** generate all substrings of the input and ** generate all substrings of the input and
 ** check if the input is a palindrome ** check if the input is a palindrome
Line 23: Line 23:
 bool is_palindrome(string str) bool is_palindrome(string str)
 { {
- bool this_is_palindrome = true; 
  // base case  // base case
  if (str.length() <= 1)  if (str.length() <= 1)
cs-142/substrings-and-palindromes.txt ยท Last modified: 2015/05/28 14:23 by cs142ta
Back to top
CC Attribution-Share Alike 4.0 International
chimeric.de = chi`s home Valid CSS Driven by DokuWiki do yourself a favour and use a real browser - get firefox!! Recent changes RSS feed Valid XHTML 1.0