Efficient coding considered harmful?

Peter Desnoyers desnoyer at Apple.COM
Fri Nov 4 03:45:04 AEST 1988


In article <1718 at garth.UUCP> smryan at garth.UUCP (Steven Ryan) writes:
>>[the context is realloc()]
>>
>>Not so.  The standard technique is to increase the size by a MULTIPLICATIVE
>>factor... I tend to use 1.5 ...
>>The total cost in this case remains O(N), N being the final size.
>
>However, this makes the space cost O(1.5**n), exponential.

No, max size <= 1.5N = O(N). There's a big difference between linear
and exponential.

				Peter Desnoyers



More information about the Comp.lang.c mailing list