File tree Expand file tree Collapse file tree 2 files changed +25
-6
lines changed
Expand file tree Collapse file tree 2 files changed +25
-6
lines changed Original file line number Diff line number Diff line change 11---
22title : 146.LRU cache
3- date : ' 2024.01.01 0:00'
3+ date : " 2024.01.01 0:00"
44tags :
55 - Python
66 - answer
77 - Linked
88 - design
99 - Hash table
1010 - 双向Linked
11-
1211abbrlink : b9130c0e
12+ docId : u0szm4sv8mr3on3ivbfo5r84
1313---
1414
1515# topic:
16- I met for the first time:'2023/3/14-15:21'
1716
17+ I met for the first time:'2023/3/14-15:21'
1818
1919[ 146.LRU cache.md] ( https://leetcode-cn.com/problems/lru-cache/ )
2020
2121# Thought:
22+
2223Simple simulation,Use the dictionary to make it,好像完全没用到双向Linked和LRU的Thought。。。I'm guilty,I can remember the air conditioner made in half a year ago。
2324answer就看Code的注释应该就能看懂,I will reply if I don’t understand。
2425
2526# Code:
27+
2628``` python
2729class LRUCache :
2830
@@ -108,4 +110,4 @@ class LRUCache:
108110 x.next = self .dummy.next
109111 x.prev.next = x
110112 x.next.prev = x
111- ```
113+ ```
Original file line number Diff line number Diff line change 11{
22 "repo" : " InvolutionHell/involutionhell" ,
3- "generatedAt" : " 2025-12-08T02:34:57.221Z " ,
3+ "generatedAt" : " 2025-12-08T03:06:09.324Z " ,
44 "docsDir" : " app/docs" ,
5- "totalDocs" : 135 ,
5+ "totalDocs" : 136 ,
66 "results" : [
77 {
88 "docId" : " ue27z7z95yzw3lhhfj7nit1c" ,
20512051 }
20522052 ]
20532053 },
2054+ {
2055+ "docId" : " u0szm4sv8mr3on3ivbfo5r84" ,
2056+ "path" : " app/docs/CommunityShare/Leetcode/[146]LRU 缓存_translated.md" ,
2057+ "contributorStats" : {
2058+ "114939201" : 1
2059+ },
2060+ "contributors" : [
2061+ {
2062+ "githubId" : " 114939201" ,
2063+ "contributions" : 1 ,
2064+ "lastContributedAt" : " 2025-12-08T03:00:38.000Z" ,
2065+ "login" : " longsizhuo" ,
2066+ "avatarUrl" : " https://avatars.githubusercontent.com/u/114939201?v=4" ,
2067+ "htmlUrl" : " https://github.com/longsizhuo"
2068+ }
2069+ ]
2070+ },
20542071 {
20552072 "docId" : " rv6egbynttb4mt1n0412bue0" ,
20562073 "path" : " app/docs/CommunityShare/Leetcode/[213]打家劫舍 II_translated.md" ,
You can’t perform that action at this time.
0 commit comments