Algorithms (due Monday Nov 10, in class)

  1. Answer chapter 5 review problem 14, 15, 22
  2. Given is a device that can print single characters with the procedure printChar(character). Furtheremore, the systems has a procedure to return the first character of a string, getFirstChar(String), and a procedure to return the string excluding the first character, splitStr(string). Design a recursive algorithm which can print a string by giving the pseudocode for procedure printStr(string) which only uses the above assignments and the procedures listed here.
  3. Modify the recursive algorithm of 2. to print the string in reverse order.