문제

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