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 | 8089 reads
|
Browse archives
Active forum topics |
Recent comments
22 weeks 6 days ago
22 weeks 6 days ago
22 weeks 6 days ago
45 weeks 15 hours ago
49 weeks 2 days ago
50 weeks 6 days ago
50 weeks 6 days ago
1 year 1 week ago
1 year 6 weeks ago
1 year 6 weeks ago