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
i am stuck on array part from getting response of jquery. anyone could help?

How Can I Retrive Unicode CSV File the ADO.net VB.net

You will be working on creating both a realistic project environment and on adding new features to a simple shell implementation provided in shell.tar.z. After you un-tar it, let's

MVC Architecture Model/view/controller (MVC) is a program structure, currently regarded an executive design used in program technological innovation. The design isolates "domain lo

How to build one dimensional list from string and build string from a list? Suppose input string is: STACKOVERFLOW then the output list should be outputList = [S,T,A,C,K,O,V,E,R,F

Project2: A Simple Distributed Computing Platform (Due at 11:59:59pm on 04/12/2012 (EST)) Description: You are asked to develop a replicator (client) that distributes a large job

This is the programming language of the Web. It is mainly used for validating forms. JavaScript & Java can be associated to each other. There exist several other differences betwee

Translate the following formula into a prefix form expression in Scheme: Question 2 Define a procedure that takes three numbers as arguments and returns the sum of the squ

Write a Prolog predicate remove_nth(N,L1,L2) that is true if list L2 is just list L1 with its Nth element removed. If L1 does not have an Nth element then the predicate should fail

The schematic of the traffic light controller is as shown in figure 1. There are three control buttons on the panel: HAZ (Hazard), LT (Left) and RT (Right). Whenever, HAZ is clicke