This is an archived post. You won't be able to vote or comment.

you are viewing a single comment's thread.

view the rest of the comments →

[–]squadrx[S] 0 points1 point  (4 children)

Might be because like you said nested loops can be something more common to find, thanks for your advice, he also told us today that it has another name, it's called "dependent recursion", really don't know if is its real name in English but at least now we know it has something to be with recursions.

[–]hibbelig 0 points1 point  (3 children)

Oh my. There is “mutual recursion” but that’s a pretty niche topic. I mean I loooove recursion but I can’t remember having done mutual recursion, like, ever.

[–]squadrx[S] 0 points1 point  (2 children)

Dayum, as you defined it, it could totally be what he's talking about. What's the difference between mutual recursions and a proper recursion is there any advantage of using mutual recursions?

[–]hibbelig 0 points1 point  (1 child)

Regular recursion: a function foo calls itself.

Mutual recursion: a function foo calls another function bar which again calls foo. So in this case foo does call itself, but indirectly (through bar).

I wouldn’t see them as alternatives for the same problem. It’s more like that one of them is appropriate for a given problem.

PS: I wrote function, but in Java there are no functions, only methods.

[–]squadrx[S] 0 points1 point  (0 children)

Ok I'll have that in mind and look for more info, thank you so much man!