Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

London | 25-SDC-July | Fatma Arslantas | Sprint 2 | Implement an LRU cache in Python #75

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

Open
AFatmaa wants to merge 1 commit into CodeYourFuture:main
base: main
Choose a base branch
Loading
from AFatmaa:feat/sprint-2-implement-lru-cache

Conversation

@AFatmaa
Copy link

@AFatmaa AFatmaa commented Jan 17, 2026
edited
Loading

Learners, PR Template

Self checklist

  • I have titled my PR with Region | Cohort | FirstName LastName | Sprint | Assignment Title
  • My changes meet the requirements of the task
  • I have tested my changes
  • My changes follow the style guide

Changelist

I implemented an LRU Cache in Python.

  • I used OrderedDict from the Python collections library.
  • OrderedDict works like a dictionary but remembers the order of items. This helps us achieve O(1) speed.
  • How it works:
    • get(key): Returns the value and moves the item to the end (marks it as recently used).
    • set(key, value): Adds a new item. If the cache is full (limit reached), it removes the first item (the oldest one).
    • Added a check to raise an error if limit is 0 or less.

Questions

I don’t have any questions, thank you!

This comment has been minimized.

@AFatmaa AFatmaa added 📅 Sprint 2 Assigned during Sprint 2 of this module Needs Review Trainee to add when requesting review. PRs without this label will not be reviewed. labels Jan 17, 2026
Copy link

@cjyuan cjyuan left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good.

@cjyuan cjyuan added Complete Volunteer to add when work is complete and all review comments have been addressed. and removed Needs Review Trainee to add when requesting review. PRs without this label will not be reviewed. labels Jan 23, 2026
Copy link
Author

AFatmaa commented Jan 25, 2026

Thank you @cjyuan 🙌

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

Reviewers

@cjyuan cjyuan cjyuan left review comments

At least 1 approving review is required to merge this pull request.

Assignees

No one assigned

Labels

Complete Volunteer to add when work is complete and all review comments have been addressed. 📅 Sprint 2 Assigned during Sprint 2 of this module

Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

2 participants

AltStyle によって変換されたページ (->オリジナル) /