Name: Anonymous 2015-05-04 23:22
How often is the answer to a tricky programming problem to use a fancy data structure?
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.