You mean recursion?
It might help in cases like a tree search. If you could pass the already searched branches to the recursive function, you can then reduce the number of rounds needed to go through the current branch (in case there are same values to be traversed through). So… may be?
but on another thought, it doesn’t have to be a recursive function specifically for achieving this so.. it’s unrelated.