errr, no. hash lookup is O(1), not log... you are thinking balanced trees or some such. also while 2D array will be a bit faster, you will have to deal with proper sizing and filling default value.
On Sat, May 22, 2010 at 8:18 PM, Terence <[email protected]> wrote: > Another point is to use array (2-D list) instead of dict to implement > cache. this will reduce the time complexity of cache lookup operation from > O(logN) to O(1) > > -- You received this message because you are subscribed to the Google Groups "google-codejam" group. To post to this group, send email to [email protected]. To unsubscribe from this group, send email to [email protected]. For more options, visit this group at http://groups.google.com/group/google-code?hl=en.
