• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Recursive vs Iterative in 4b Say

 
Julie Purcell
Greenhorn
Posts: 5
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 9067
12
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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 ]
 
Julie Purcell
Greenhorn
Posts: 5
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic