Recursion function, Programming Languages

Use recursion to de ne a function position which has as input an integer, a character and a string and returns the result of inserting the character in the string at the position speci ed by the integer. For example: position 4

'a' "012xyz6" = "012xayz6"

An error message should be returned for negative input or if the position is more than the length of the string. De ne a function position2 which has the same e ect as position but which is de ned using take and drop instead of recursion

Posted Date: 3/1/2013 2:55:10 AM | Location : United States







Related Discussions:- Recursion function, Assignment Help, Ask Question on Recursion function, Get Answer, Expert's Help, Recursion function Discussions

Write discussion on Recursion function
Your posts are moderated
Related Questions
Lexical Analyzer: Symbol Table - Holds the symbols accepted by the lexical analyzer or parser.  Each symbol may be a terminal or a non-terminal.  Terminal symbols are listed

Use an insertion sort to sort an array (sequence) of long word integers. The size of the list will appear just before the list itself. Use the same labels as in this example: LE


Introduction This assignment builds on your application, produced in Assignment 1, which holds a list of cabins, which can be either read in from a text file or just hard coded

how do u define a letter in python "NameError: name ''r'' is not defined"

In this Project your task is to create a program that displays various levels of the fractal structure of the so called square shaped Sierpinski-carpet. The display of level 4 is s

Write a Perl script that prints the contents of a file Write a Perl script that prints the contents of a file, prefixing each line with a line number. The script should acc

write c++ source code to find the number of digits in a given integer? pls ans

Given a file named maze1.txt whose contents is 1 0 2 2 1 2 3 0 3 2 2 1 2 0 2 2 3 0 1 1 3 1 0 0 2 0 3 0 0 1 2 0 3 2 2 0 1 2 3 2 1 0 0 1 1 0 0 0 your program when run as a.out

JSP QUIZ ASSIGNMENT SHOULD BE FUNCTIONAL ON ECLIPSE QUIZ HAS TOTAL 20 QUESTIONS REGARDING VARIOUS CAPITALS OF COUNTRIES. WELCOME PAGE OFFERS USER TO ENTER HIS NAME. THEN USER C