Easy, Quick recursion programs

Suoritettu Julkaistu Oct 21, 2004 Maksettu toimituksen yhteydessä
Suoritettu Maksettu toimituksen yhteydessä

1. Write a java class named **my_WordReverse** using recursion. It takes a sentence and returns the sentence in reverse order. For example, given “welcome to recursion world?? as input, the program should print out “world recursion to welcome??. Note that space is the only separator.

2. Write a recursive function **my_findAncestorsDescendants** to find all the ancestors and descendants of X.

**Input:** “Relationship pairs?? and element X. Each pair is of the form, (father, child)

**Output:** all ancestors and descendants of X

For example: we have the following pairs (the sequence of the pairs is random):

(Nick, John) (Jack, Nilson) (Tom, Mike) (John, Jack) (Jack, David)

If we use **my_findAncestorsDescendants**() to find the ancestors of Jack, <John, Nick>, and descendants of Jack, <David>, should be returned.

**Instructions**

1. Ther programs should run like:

Problem 1:

Enter string:

welcome to recursion world

Reverse string:

world recursion to welcome

Problem 2: (In testing the program, I can input any number of relationship pairs).

Enter the relationship pairs:

(Jack, Nilson) (Jack, David), (Peter, John) (David, Bert) (Tom, Mike) (John, Jack)

Whose ancestors and descendants do you want to find?

Jack

Result: Jack’s ancestors are <Peter, John>

Jack’s descendants are <Nilson, David, Bert>

Note that: the sequences of the returned ancestors and descendants are not important.

## Deliverables

**What I need**: You have to write two java files, one is named **[url removed, login to view]**, and the other is named **my_findAncestorsDescendants****.java**. You should write main function within each java file. So that after compiling them, I can run it directly.

Please comment the code.

Also, you MUST use recursion for both problems. I will not accept any program that does not use recursion even if the program for the question works perfectly fine.

1) Complete and fully-functional working program(s) in executable form as well as complete source code of all work done.

2) Deliverables must be in ready-to-run condition.

## Platform

Has to be written in java

tekniikka Java MySQL PHP Tietojärjestelmäarkkitehtuuri Ohjelmistojen testaus

Projektin tunnus: #3398393

Tietoa projektista

21 ehdotusta Etäprojekti Aktiivinen Oct 21, 2004

Myönnetty käyttäjälle:

senzaciosnegyes

See private message.

$6 USD 2 päivässä
(104 Arvostelua)
4.9

21 freelanceria on tarjonnut keskimäärin $20 tähän työhön

kmoniqa

See private message.

$21.25 USD 2 päivässä
(128 arvostelua)
6.2
navol

See private message.

$19.55 USD 2 päivässä
(107 arvostelua)
6.1
makeurownrulesvw

See private message.

$21.25 USD 2 päivässä
(69 arvostelua)
6.1
bbarar

See private message.

$7.47 USD 2 päivässä
(317 arvostelua)
6.0
seninandrew

See private message.

$29.75 USD 2 päivässä
(61 arvostelua)
6.0
kupradeep

See private message.

$17 USD 2 päivässä
(39 arvostelua)
5.2
petrutandy

See private message.

$25.5 USD 2 päivässä
(54 arvostelua)
5.2
cata77

See private message.

$8.5 USD 2 päivässä
(126 arvostelua)
5.2
meansolutionsllc

See private message.

$29.75 USD 2 päivässä
(25 arvostelua)
5.0
mcduckvw

See private message.

$21.25 USD 2 päivässä
(34 arvostelua)
4.9
ujnipvw

See private message.

$34 USD 2 päivässä
(25 arvostelua)
4.2
starlightsoft

See private message.

$33.96 USD 2 päivässä
(10 arvostelua)
4.1
adlivw

See private message.

$25.5 USD 2 päivässä
(25 arvostelua)
3.9
eudjtt

See private message.

$21.25 USD 2 päivässä
(10 arvostelua)
3.6
PDan

See private message.

$8.5 USD 2 päivässä
(9 arvostelua)
3.4
raduzah

See private message.

$12.75 USD 2 päivässä
(4 arvostelua)
2.9
sprucevw

See private message.

$7.65 USD 2 päivässä
(12 arvostelua)
1.2
lazardan

See private message.

$8.5 USD 2 päivässä
(1 arvostelu)
0.0
vaxyzek

See private message.

$25.5 USD 2 päivässä
(0 arvostelua)
0.0
topkai22

See private message.

$29.75 USD 2 päivässä
(0 arvostelua)
0.0