Skip to content

Conversation

@AFatmaa
Copy link

@AFatmaa AFatmaa commented Jan 17, 2026

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!

@github-actions

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
@AFatmaa
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

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

Development

Successfully merging this pull request may close these issues.

2 participants