Re:Building a Maze by Destroying Walls Efficiently
by teraflop on Saturday April 02, 2011 @12:02PM
(#2400173)
This "efficient" algorithm takes O(n^2) time (where n is the number of grid squares) because it has to repeatedly remove elements from the middle of a list. It can easily be improved to O(n) by simply shuffling the list once and traversing it in order.
[ Parent
| on HN ]
There are no comments on this comment yet.