shuffling lines in a stream

BCS ao at pathlink.com
Fri Oct 10 15:13:14 PDT 2008


Reply to Andrei,


> Well I agree things can be coded such that you make the copy only if
> the file is too large anyway. But one lseek call per line is a
> complete disaster, whether you call it I/O effect or whatnot. I'd go
> as far as saying I'd never even try such a solution, especially since
> there exists a forward-pass algorithm. Of course measuring would be a
> great way to prove me wrong.
> 
> Andrei
> 

I think Big-O on mine is n.

I don't think that can be beat. (Maybe I was being not at all clear that 
I was only looking at that aspect, the rest doesn't interest me as a puzzle)





More information about the Digitalmars-d mailing list