Re: Recursion help.



oh, I thought it was just where you have an iteration inside another
iteration or like nested loops or something. Hmm. Thanks for the help.


I tried your version of the program. It seems to go into an endless
loop, or just takes a REALLY long time. I stopped it after 30
seconds.

Honestly, I don't really understand a whole lot of this. I just kind
of throw things together until they work, but I am getting a lot
better at understanding, which is why I like to see if people can make
my program better. I can then ask why they did the things they do.

So, I see why you would use "w" and not "w+", but why do you use the
ARGV[0] ||?
I know that ARGV is an array, but I don't know what it is used for, or
why you would use it instead of making your own array. Also, why would
you assign the filename the user input *or* ARGV[0]?

The thing with the each_with_index is that the second record will have
a sequence of 2, and it should have a sequence of 1. So sequence only
goes up to the total carton size. It is a ?? of ?? cartons i.e. 1 of
12 - 12 of 12.

This stuff gives me a good head start though, thanks for the
information.

~Jeremy

On Nov 15, 10:15 am, Sebastian Hungerecker <sep...@xxxxxxxxxxxxxx>
wrote:
JeremyWoert...@xxxxxxxxx wrote:
I suck at recursion, and I need some help understanding where I'm
going wrong here.

You're not using recursion at all in your code. Recursion is if a method
invokes itself.

--
NP: Moonsorrow - Kivenkantaja
Jabber: sep...@xxxxxxxxxx
ICQ: 205544826

.



Relevant Pages

  • Re: Steve Summit C Notes {Anticipating the next one}
    ... then recursion or iteration might ... If you just want one value at a specified place in the sequence, ... but solves the problem in a general sense. ...
    (comp.lang.c)
  • Re: Steve Summit C Notes {Anticipating the next one}
    ... in mind that is simpler? ... then recursion or iteration might ... If you just want one value at a specified place in the sequence, ...
    (comp.lang.c)
  • Re: convert nested for loop to recursion
    ... So if your first digit is a 0, all possible 2nd digits are right of it ... It's really more of a looping problem than a recursion problem. ... Sequence being operative terms that suggest Loop. ... homework that requires recursion, I'd suggest nested loops. ...
    (comp.lang.java.programmer)
  • Re: collatz proof algorithm reveals e
    ... seen Stopping Time refer to the iteration count from ... numbers in a sequence based on the bit-pattern of n. ... but that sequence will NOT be a Sequence Vector because ... And that brings me to your algorithm. ...
    (sci.math)
  • Re: A tiny Collatz-exercise
    ... as one single step, and consider Cfor odd x only. ... This sequence is strictly increasing, which is obvious, ... bit per iteration. ... which doesn't take certain realities of the Collatz ...
    (sci.math)