> > Bernie Cosell wrote: > > My intuition is that the problem is too constrained > > and that there *is*no* algorithm that meets all the > > criteria, but I'd be delighted to be proven wrong... > > Simon Cozens wrote: > The original problem - finding a random line in a file > - was solved by induction. I tried to apply something > similar to this problem. n=1 is easy. What does it mean > to take the middle line of a file when n=2?
I honestly think I've found the only true solution, which is: perl -p I.e. the only storage you require is for the current line... which is just printed. Meets requirements AFAIK so it looks like a trick problem! Jonathan Paton __________________________________________________ Do You Yahoo!? Everything you'll ever need on one web page from News and Sport to Email and Music Charts http://uk.my.yahoo.com
