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
Exception handling Exception handling is a mechanism that separates code that detects and handles exceptional circumstances from the rest of your program. Note that an exceptional

The classical connect-4 game is played on a 67 board, it can in fact be played in any nrRowsnrCols board. In your implementation, the user will specify the number of rows nrRows an

Implement the Prim's algorithm with array data structure as described in slide 12 of the file 04mst.ppt. Your program should have a runtime complexity of O(n2) and should be as eff

Tasks: Write a Perl script assignGrades.pl to assign letter grades to the students. Please use the classList2.txt file. Upon invoking, the script will access the file classL

Detailed Description: • The program will take temperature readings as input from user for specified number of consecutive days. • Program will store these temperature values into

create a small database for a company, require at least 4 tables. also, have 4 business report, oracle built-in function, 5 string, 5 number or math functions, 5 date and time func

Write a function called triple (in a file called 'triple.m'). That takes a single variable x and returns a single variable in which every element of x is multiplied by 3. Make sure

Program for Operate the Rolodex Rolodex is a rotating file, usually used to record business contact information. Cards are inserted in alphabetic order by name. You operate th

Normal 0 false false false EN-US X-NONE X-NONE MicrosoftInternetExplorer4

W.A.S.S to display all the files in a specified directory in the following format: File  size in K        Date   Protection    Owner Program echo -e "Enter dir : \c" read di