|
From: Nicholas N. <nj...@cs...> - 2007-02-25 12:35:45
|
On Sun, 25 Feb 2007 sv...@va... wrote: > Log: > Expandable arrays of arbitrary element type T are a simple, useful > abstraction implemented independently in several places in the code > base (bad!). This commit moves into public view a generic > implementation of it which has been lurking in readxcoff.c for some > time. Currently nothing uses it. Nice! > +//-------------------------------------------------------------------- > +// PURPOSE: Provides a simple but useful structure, which is an array > +// in which elements can be added at the end. The array is expanded > +// as needed by multiplying its size by a constant factor (usually 2). > +// This gives amortised O(1) insertion cost, and, following sorting, > +// the usual O(N log N) binary search cost. Arbitrary element sizes Should that be O(log N) binary search cost? Nick |