This week's book giveaway is in the Servlets forum.
We're giving away four copies of Murach's Java Servlets and JSP and have Joel Murach on-line!
See this thread for details.
The moose likes Cattle Drive and the fly likes Recursive vs Iterative in 4b Say Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Murach's Java Servlets and JSP this week in the Servlets forum!
JavaRanch » Java Forums » This Site » Cattle Drive
Bookmark "Recursive vs Iterative in 4b Say" Watch "Recursive vs Iterative in 4b Say" New topic
Author

Recursive vs Iterative in 4b Say

Julie Purcell
Greenhorn

Joined: Apr 18, 2004
Posts: 5
I have just rejoined the cattle drive and the last feedback I got on this assignment was that an iterative approach would be better than a recursive approach but I'm not sure what this means in the context of my code to date.

I currently use a while loop to pick out the first three numbers from the right, the next 3 etc and was also asked to try and think from left to right rather than from right to left.

Julie
Marilyn de Queiroz
Sheriff

Joined: Jul 22, 2000
Posts: 9044
    
  10
I got your assignment just before my computer died again. The nitpicker must have been really tired when it was done because I didn't see any recursion. However, going from right to left rather than from left to right has been discussed here before. When I have a few more minutes, I'll try to do a search in this forum to see if I can find one of those discussions for you unless you get to it before then.

(I'll be working later today on getting the info off my other hard drive onto one that works consistently.)
[ March 18, 2006: Message edited by: Marilyn de Queiroz ]

JavaBeginnersFaq
"Yesterday is history, tomorrow is a mystery, and today is a gift; that's why they call it the present." Eleanor Roosevelt
Julie Purcell
Greenhorn

Joined: Apr 18, 2004
Posts: 5
Thanks for feedback Marilyn and for forwarding on 4a too. I finally understand why we should go from left to right so will hopefully be forwarding my next attempt shortly....

Julie
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Recursive vs Iterative in 4b Say
 
Similar Threads
Java-4b Please
Recursively Set Tester in a Recursive Tree
Why recursion?
Recursion
Say ( b ) Tips, Tricks, Hints, Help?