Skip to content

Getting the length of the dictionary should return # of items not expired #39

Description

@chanchiem

Since items are only removed on retrieval, calling the len method on the dictionary will return all the items in the dictionary--including the expired items.

Length should iterate through the internal list and find what items are expired and remove them appropriately. Since it's internally implemented using an OrderedDict, we can perform a binary search to find what items in the dictionary have expired in Log(n) time

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions