in reply to Glob powerset with progressive ordering
This is insanely clever! ++
Though I agree with using the term "iterator" for this snippet, it is worth noting that the space requirement grows at least1 as ~ log(N)(2N-1)2, so it is not an "iterative algorithm" (whose space requirements would be constant).
1I write "at least" because I haven't the foggiest idea of what perl is doing under the hood with glob; for all I know, it pre-computes all 2N -1 elements and dishes them out one by one.
Update: Added a missing log factor to my estimate for the space requirement; it arises from the fact that the number of digits per element grows logarithmically with N.
the lowliest monk
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: Glob powerset with progressive ordering
by Roy Johnson (Monsignor) on Apr 27, 2005 at 10:53 UTC |