質問

I have this problem on my homework and I don't understand it.

Assume there are four methods A, B, C, and D. Method A calls method B, and method B calls method A. Method C calls method D, and method D calls method A. Which of the following methods is indirectly recursive?

What is indirectly recursive and what isn't?

役に立ちましたか?

解決

A -> B -> A <- D <- C

Indirectly Recursive : Method A and B, as they indirectly call themselves by calling each other.

Directly Recursive : None of them as no method calls itself.

See this link for detailed information.

ライセンス: CC-BY-SA帰属
所属していません StackOverflow
scroll top