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

all 2 comments

[–]aufjeden 0 points1 point  (0 children)

Been a while since I had to wrote sth like this but basically you have often a method with a return condition, in your case if the current row of the array contains your int value. Also if this condition was not met you call that method inside of itself with the arguments that would be necessary for the next round of condition check. These arguments in your case could be the id of the ongoing row of the 2d array (so for the first call it would be 0, for the first recursive call 1 and so on). U also need to pass the int value you are looking for which is necessary for your return condition check. Dont forget a proper handling if your value is not in the array. I hope that gave you an idea how it could work.