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 | 8010 reads
|
Browse archives
Active forum topics |
Recent comments
6 weeks 15 hours ago
6 weeks 19 hours ago
6 weeks 19 hours ago
28 weeks 2 days ago
32 weeks 3 days ago
34 weeks 1 day ago
34 weeks 1 day ago
36 weeks 5 days ago
41 weeks 3 days ago
41 weeks 3 days ago