Disposable Data-Structure

Suppose we use a linked list to implement a slight variation of a dictionary . Assuming no duplicate elements are provided, we can just insert elements at the beginning of the list. Assume the peculiar situation that the client may perform any number of insert operations but will only ever perform at most one lookup operation.

What will the worst-case amortized running-time of the lookup and insert operations performed on this data structure be?

Insertion : O ( 1 ) O(1) ; Look-up : O ( 1 ) O(1) Insertion : O ( n ) O(n) ; Look-up : O ( 1 ) O(1) Insertion : O ( 1 ) O(1) ; Look-up: O ( n ) O(n) Insertion : O ( 1 ) O(1) ; Look-Up: O ( l o g ( n ) ) O(log(n))

This section requires Javascript.
You are seeing this because something didn't load right. We suggest you, (a) try refreshing the page, (b) enabling javascript if it is disabled on your browser and, finally, (c) loading the non-javascript version of this page . We're sorry about the hassle.

0 solutions

No explanations have been posted yet. Check back later!

0 pending reports

×

Problem Loading...

Note Loading...

Set Loading...