Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: add doubly-linked list implementation #970

Merged
merged 4 commits into from Aug 14, 2021

Conversation

johnnylam88
Copy link
Contributor

Add doubly-linked list implemented as a circular list. The API of
the List class is almost identical to the Deque API.

A List uses more memory than a Queue, but a List takes O(1)
time to do insertions and removals anywhere in the list, whereas a
Queue only takes O(1) time to do insertions and removals at the
front and back of the queue, and O(n) everywhere else.

Also add a testsuite for the List class.

Add doubly-linked list implemented as a circular list. The API of
the `List` class is almost identical to the `Deque` API.

A `List` uses more memory than a `Queue`, but a `List` takes O(1)
time to do insertions and removals anywhere in the list, whereas a
`Queue` only takes O(1) time to do insertions and removals at the
front and back of the queue, and O(n) everywhere else.

Also add a testsuite for the `List` class.
Add remove(value) to remove a value from the cache independently
from the eviction policy.
@Sidoine Sidoine merged commit e35f10b into Sidoine:master Aug 14, 2021
@johnnylam88 johnnylam88 deleted the feat/linked-list branch August 14, 2021 12:34
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants