Results 1 to 7 of 7
Thread: Recursion in Java ..
- 10-24-2008, 11:01 AM #1
Member
- Join Date
- Oct 2008
- Posts
- 6
- Rep Power
- 0
- 10-24-2008, 11:22 AM #2
Member
- Join Date
- Oct 2008
- Posts
- 6
- Rep Power
- 0
any help? i got to have it working within 20 mins!
- 10-24-2008, 11:28 AM #3
- Join Date
- Jul 2007
- Location
- Colombo, Sri Lanka
- Posts
- 11,374
- Blog Entries
- 1
- Rep Power
- 18
What you have done so far, can you show your code here.
- 10-24-2008, 11:33 AM #4
Member
- Join Date
- Oct 2008
- Posts
- 6
- Rep Power
- 0
i havn't done much, i need help starting it off, i have a few notes here and there.. like :
public String rev3 (String str1, String str2, int num) {
if ((str1.length()) == 0) return str2;
im just really stuck lol, if you can help start me off i can get it hopefully!
- 10-24-2008, 11:35 AM #5
- Join Date
- Jul 2007
- Location
- Colombo, Sri Lanka
- Posts
- 11,374
- Blog Entries
- 1
- Rep Power
- 18
This is not related with recursion. I don't know from where you came with that word.
Here is a simple way to do it.
Java Code:String str = "bcdefg"; str = str.substring(0, 4) + "a" + str.substring(4); System.out.println(str);
- 10-24-2008, 11:40 AM #6
Member
- Join Date
- Oct 2008
- Posts
- 6
- Rep Power
- 0
oh ok, we got taught that way in lectures, we used a method called rev3, recursion but thanks!
- 10-24-2008, 11:42 AM #7
- Join Date
- Jul 2007
- Location
- Colombo, Sri Lanka
- Posts
- 11,374
- Blog Entries
- 1
- Rep Power
- 18
That's why best to use a descriptive name for method defining.
Similar Threads
-
java recursion infinite loop
By tony404 in forum Advanced JavaReplies: 9Last Post: 10-03-2008, 01:16 PM -
help with recursion
By Nari in forum New To JavaReplies: 15Last Post: 04-24-2008, 09:13 AM -
i could not get the recursion in java
By sivasayanth in forum New To JavaReplies: 3Last Post: 04-23-2008, 08:08 AM -
Help With Recursion
By andrew777 in forum New To JavaReplies: 1Last Post: 03-29-2008, 12:51 PM -
Recursion in java
By lenny in forum Advanced JavaReplies: 1Last Post: 08-07-2007, 06:23 AM


LinkBack URL
About LinkBacks
Reply With Quote
Bookmarks