dkj4jdk
There are only two hard things in computer science: cache invalidation, naming things, and off-by-one errors
dkj4jdk
As they say here in Teesside, "Thereygo".Deepak Kumar Jena wrote:Thanks Fred, but a code snippet will be more helpful.
Deepak Kumar Jena wrote:Thanks Fred, but a code snippet will be more helpful.
There are only two hard things in computer science: cache invalidation, naming things, and off-by-one errors
Regards, Rene Larsen
fred rosenberger wrote:
Deepak Kumar Jena wrote:Thanks Fred, but a code snippet will be more helpful.
We generally don't just give out answers. Too many folks would be tempted to use us to cheat on their homework.
do you know what recursion is? Have you ever written a recursive function? It's a function that calls itself, each time reducing to a simpler case.
Printing something 1000 times is easy. you just print it once, and then call a function that prints it 999 more times.
Printing something 999 times is easy. you just print it once, and then call a function that prints it 998 more times.
Printing something 998 times is easy. you just print it once, and then call a function that prints it 997 more times...
...
Printing something 2 times is easy. you just print it once, and then call a function that prints it 1 more time.
Printing something 1 time is easy. you just print it once, and then don't call any other function.
SCJP 1.4 - SCJP 6 - SCWCD 5 - OCEEJBD 6 - OCEJPAD 6
How To Ask Questions How To Answer Questions
dkj4jdk
Deepak Kumar Jena wrote: . . . a small piece of code . . .
There are only two hard things in computer science: cache invalidation, naming things, and off-by-one errors
star chaser..
SCJP 1.4 - SCJP 6 - SCWCD 5 - OCEEJBD 6 - OCEJPAD 6
How To Ask Questions How To Answer Questions
Of course people create infinite recursion. It is very useful. You can kick the computer, shout, "The bl**d* thing will never work," and then, most important of all . . .Gary Ba wrote: . . . I wonder if programmers create an infinite recursion and what is use for? . . .
Gary Ba wrote:I wonder if programmers create an infinite recursion and what is use for?
There are only two hard things in computer science: cache invalidation, naming things, and off-by-one errors
dkj4jdk
dkj4jdk
SCJP 1.4 - SCJP 6 - SCWCD 5 - OCEEJBD 6 - OCEJPAD 6
How To Ask Questions How To Answer Questions
An elephant? An actual elephant. Into the apartment. How is the floor still here. Hold this tiny ad:
a bit of art, as a gift, that will fit in a stocking
https://gardener-gift.com
|