What’s the best approach when data structures are being built from scratch? or How do you optimize pe

22 Replies, 899 Views

If you’re winging it, at least use a language with decent defaults. Java’s ArrayList or C#’s List<T> handle growth pretty well.

But if you’re rolling your own, maybe try a tiered approach? Like, small chunks first, then consolidate later.

Horror story: Once had a hash table resize mid-loop. Never again. Now I always pre-size if I can.

Messages In This Thread



Users browsing this thread: 1 Guest(s)