Path: utzoo!utgpu!news-server.csri.toronto.edu!cs.utexas.edu!usc!samsung!think.com!paperboy!hsdndev!cmcl2!kramden.acf.nyu.edu!brnstnd From: brnstnd@kramden.acf.nyu.edu (Dan Bernstein) Newsgroups: comp.lang.c Subject: Re: Complexity of reallocating storage (was users command crap) Message-ID: <23341:Jan3018:27:1091@kramden.acf.nyu.edu> Date: 30 Jan 91 18:27:10 GMT References: <6662@exodus.Eng.Sun.COM> <15325:Jan2903:19:4991@kramden.acf.nyu.edu> <19010@rpp386.cactus.org> Organization: IR Lines: 13 In article <19010@rpp386.cactus.org> jfh@rpp386.cactus.org (John F Haugh II) writes: > In article <15325:Jan2903:19:4991@kramden.acf.nyu.edu> brnstnd@kramden.acf.nyu.edu (Dan Bernstein) writes: > >Any single-pass ``users'' has to either use quadratic time or be a rude > >abuser of resources. Why not use two passes and be done with it? > No, it doesn't. It can get it exactly right the first time and be done > with it. No, your solution insists upon allocating space for empty entries in utmp. If utmp has ten thousand slots and there are only a thousand people logged in, you're using ten times too much space. Other than that it's fine. ---Dan