^ Just a clarification, my algorithm is already posted above and works (I'll leave as an exercise to the reader what needs to be changed about the java implementation to make it work).
Type: Posts; User: CT&SC
^ Just a clarification, my algorithm is already posted above and works (I'll leave as an exercise to the reader what needs to be changed about the java implementation to make it work).
Huh. Just implemented my version using javascript. I let n = 3 and made isPartialSolution the "true" function. Here's the output:
000
001
010
011
100
101
110
111
"The code that I posted above is correct and there is no need to include n in the loop. You are welcome to run it and see for yourself that it stops."
- I think I now understand that you avoided...
Just out of curiosity, does my algorithm do what you want? I'm still not sure I've even understood what you're trying to do.
And correct me if I'm wrong, but how does your start() function know...
I'm really not sure I understand what you're asking for... why do these iterative solutions not work?
After looking at your code a little more carefully, I think I might have deciphered what you...
Is what you want an iterative tree traversal algorithm? That isn't too hard to make iterative.
All you need to do is to design a state machine with the following transitions:
START:
- if there...