Timeline for How does one formulate a backtracking algorithm
Current License: CC BY-SA 3.0
14 events
when toggle format | what | by | license | comment | |
---|---|---|---|---|---|
Apr 30, 2015 at 13:03 | history | edited | babou | CC BY-SA 3.0 |
Shorter title to make it more general (with ok from OP)
|
Apr 28, 2015 at 1:13 | comment | added | Will Ness |
just for completeness, in ND-supporting language, we can write code following the ND "thinking", e.g. mapM (const [0,1]) [0..2] (in Haskell, using list monad to model non-determinism by exhaustive calculation) which returns [[0,0,0],[0,0,1],[0,1,0],[0,1,1],[1,0,0],[1,0,1],[1,1,0],[1,1,1]] . -- -- -- and powerset is, similarly, filterM (const [True,False]) [0..2] which returns [[0,1,2],[0,1],[0,2],[0],[1,2],[1],[2],[]] .
|
|
Apr 22, 2015 at 11:26 | comment | added | babou | Thanks. - ** Is it ok for me to shorten the title? ** - - - - - Also, I added at the beginning a section explaining better the generality of underlying principles. | |
Apr 22, 2015 at 10:09 | vote | accept | ManMohan Vyas | ||
Apr 21, 2015 at 15:11 | history | tweeted | twitter.com/#!/StackCompSci/status/590533289309577218 | ||
Apr 21, 2015 at 8:17 | comment | added | babou | @YuvalFilmus Thank you. Actually I know C arrays are from 0 to n-1, but I am language agnostic. The point is the array is missing one element. Whether it is A[0] or A[n] is immaterial to me. But you are right ... and doing that may disturb readers. | |
Apr 21, 2015 at 5:24 | answer | added | Yuval Filmus | timeline score: 3 | |
Apr 21, 2015 at 5:15 | comment | added | Yuval Filmus | @babou C arrays are zero based. | |
Apr 20, 2015 at 16:41 | comment | added | babou | Maybe you title should better be "How does one formulate a backtracking algorithm?", since that is really your question. Generating permutations is only an example of a problem that can use that skill. I think mentioning the example in the title is misleading regarding the topic ... You can edit it. | |
Apr 20, 2015 at 16:37 | answer | added | babou | timeline score: 6 | |
Apr 20, 2015 at 15:53 | comment | added | babou | There seems to be a bug in your program: A[n] never gets a value. | |
Apr 20, 2015 at 15:38 | history | edited | babou | CC BY-SA 3.0 |
tags titke syntax
|
Apr 20, 2015 at 15:27 | review | First posts | |||
Apr 20, 2015 at 15:39 | |||||
Apr 20, 2015 at 15:22 | history | asked | ManMohan Vyas | CC BY-SA 3.0 |