{"id":25328442,"url":"https://github.com/eshan-sud/cache-simulator","last_synced_at":"2025-04-08T02:49:45.747Z","repository":{"id":276964760,"uuid":"930867809","full_name":"eshan-sud/cache-simulator","owner":"eshan-sud","description":"A simple LRU-based Cache Simulator","archived":false,"fork":false,"pushed_at":"2025-02-11T11:14:57.000Z","size":16,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-02-11T12:26:08.752Z","etag":null,"topics":["cache-simulator","cpp","lru-cache"],"latest_commit_sha":null,"homepage":"","language":"C++","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/eshan-sud.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2025-02-11T10:45:49.000Z","updated_at":"2025-02-11T11:16:49.000Z","dependencies_parsed_at":"2025-02-11T12:26:18.223Z","dependency_job_id":"015edbaf-0d11-4ec2-b071-ede728b7848a","html_url":"https://github.com/eshan-sud/cache-simulator","commit_stats":null,"previous_names":["eshan-sud/cache-simulator"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/eshan-sud%2Fcache-simulator","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/eshan-sud%2Fcache-simulator/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/eshan-sud%2Fcache-simulator/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/eshan-sud%2Fcache-simulator/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/eshan-sud","download_url":"https://codeload.github.com/eshan-sud/cache-simulator/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247767254,"owners_count":20992541,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["cache-simulator","cpp","lru-cache"],"created_at":"2025-02-14T02:33:20.948Z","updated_at":"2025-04-08T02:49:45.731Z","avatar_url":"https://github.com/eshan-sud.png","language":"C++","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Cache Simulator\n\nImplemented in C++, an LRU (Least Recently Used) cache simulator\n\nTools : C++, Operating Systems concepts\n\n\n\n\nCompilation:\n\n\tg++ src/lru_cache.cpp -o src/lru_cache\n\t./src/lru_cache\n\n\nExplanation of Output:\n\n\n| Step | Operation                             | Expected Output | Explanation                                                                  |\n|------|---------------------------------------|-----------------|------------------------------------------------------------------------------|\n| 1    | put(1,100), put(2,200), put(3,300)    | N/A             | Cache is now {1:100, 2:200, 3:300}                                           |\n| 2    | get(1)                                | 100             | Accessing key 1 makes it Most Recently Used (MRU)                            |\n| 3    | put(4,400)                            | N/A             | Evicts key 2 (Least Recently Used - LRU). Cache is now {1:100, 3:300, 4:400} |\n| 4    | get(2)                                | -1              | Key 2 was evicted, so it’s not in the cache                                  |\n| 5    | get(3)                                | 300             | Key 3 is present in the cache                                                |\n| 6    | get(4)                                | 400             | Key 4 is present in the cache                                                |\n| 7    | put(5,500)                            | N/A             | Evicts key 1 (Least Recently Used - LRU). Cache is now {3:300, 4:400, 5:500} |\n| 8    | get(1)                                | -1              | Key 1 was evicted                                                            |\n| 9    | get(5)                                | 500             | Key 5 is present in the cache                                                |\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Feshan-sud%2Fcache-simulator","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Feshan-sud%2Fcache-simulator","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Feshan-sud%2Fcache-simulator/lists"}