User loginNavigation |
Reversing operationsIf one wants to iterate through all reachable states s1 from an initial state s0 in an imperative language (think of a chess board and a possible set of moves) one could do something like: for i in 1..#changes { s1 := copy(s0) change(s1, i) // process s1 } It is usually faster and less memory intensive to do the following instead: for i in 1..#changes { change(s0, i) pushing undo data to the stack // process s0 undo(s0) popping undo data from the stack } Are there general techniques for inferring the "undo data" that an operation should save, and possibly the corresponding undo operation? By Pablo Barenbaum at 2012-03-12 17:03 | LtU Forum | previous forum topic | next forum topic | other blogs | 8059 reads
|
Browse archives
Active forum topics |
Recent comments
16 weeks 1 day ago
16 weeks 1 day ago
16 weeks 1 day ago
38 weeks 2 days ago
42 weeks 4 days ago
44 weeks 1 day ago
44 weeks 1 day ago
46 weeks 6 days ago
51 weeks 4 days ago
51 weeks 4 days ago