benqbenq
❔ Can anyone explain this piece of code
If you are talking about the algorithm itself, I don't think I can help you because:
1) recursive functions are hard to track
2) I'm DUM
The "ref" keyword means the value is passed by reference: so when some recursive call stop at some point and start going backwards to the initial caller, the intermediate calculated values (with "ref" keyword ones) will be not the same, as they were before stepping into this recursive call. To illustrate, here's an example:
9 replies