Return Styles: Pseud0ch, Terminal, Valhalla, NES, Geocities, Blue Moon. Entire thread

Advanced Data Structures

Name: Anonymous 2015-05-04 23:22

How often is the answer to a tricky programming problem to use a fancy data structure?

Name: Anonymous 2015-05-17 15:32

So append is actually O(n)
Good thing you've finally noticed.

but still Θ(1)
No, it's still Θ(n). You have to allocate a new, larger array, then copy all the n items from the old array to the new, then free the memory taken up the the old array.

Newer Posts
Don't change these.
Name: Email:
Entire Thread Thread List