Skip to content
Advertisement

Tag: recursion

How multiple recursion works? [closed]

Closed. This question needs details or clarity. It is not currently accepting answers. Want to improve this question? Add details and clarify the problem by editing this post. Closed 3 years ago. This post was edited and submitted for review 4 months ago and failed to reopen the post: Original close reason(s) were not resolved Improve this question I need

how to traverse a Boolean recursion array

The exercise: Build a recursion(with no loops) that every cell that you go inside is the number of steps that you can go, it could be right/left until you get to the last cell. if you can’t get to the last cell return false, else return true. you must start from index 0. My problem: I build the program, it’s

Reverse Linked-List Recursive

I’ve traced through my code to reverse a linked-list using recursion, and I cannot find anything wrong with it, but I know it does not work. Can anyone please explain why? Answer Below is a working version of your code, added with some helping structures:

Java: Find out if a number is prime recursively

I’m writing a function that returns true if a number is prime, and false otherwise Here is my current code: It works for a lot of test cases except numbers like “1000000007” where I get an Out of memory error. How could I tweak this code to be more efficient space-wise? Answer The first problem I see is that your

Advertisement