Run Code  | API  | Code Wall  | Users  | Misc  | Feedback  | Login  | Theme  | Privacy  | Patreon 

ruby LRU cache with constant get/set

Language: Layout:
+ ] Show input
Absolute running time: 0.14 sec, cpu time: 0.04 sec, memory peak: 7 Mb, absolute service time: 0.15 sec 
fork mode |  history  | discussion
o3
o6
o5
o4
o2

{"o2"=>["more stuff", #<struct Node value="o2", next=nil, prev=#<struct Node value="o4", next=#<struct Node:...>, prev=#<struct Node value="o5", next=#<struct Node:...>, prev=#<struct Node value="o6", next=#<struct Node:...>, prev=#<struct Node value="o3", next=#<struct Node:...>, prev=#<struct Node:...>>>>>>], "o3"=>["works well", #<struct Node value="o3", next=#<struct Node value="o6", next=#<struct Node value="o5", next=#<struct Node value="o4", next=#<struct Node value="o2", next=nil, prev=#<struct Node:...>>, prev=#<struct Node:...>>, prev=#<struct Node:...>>, prev=#<struct Node:...>>, prev=#<struct Node value="o4", next=#<struct Node value="o2", next=nil, prev=#<struct Node:...>>, prev=#<struct Node value="o5", next=#<struct Node:...>, prev=#<struct Node value="o6", next=#<struct Node:...>, prev=#<struct Node:...>>>>>], "o4"=>["more stuff", #<struct Node value="o4", next=#<struct Node value="o2", next=nil, prev=#<struct Node:...>>, prev=#<struct Node value="o5", next=#<struct Node:...>, prev=#<struct Node value="o6", next=#<struct Node:...>, prev=#<struct Node value="o3", next=#<struct Node:...>, prev=#<struct Node:...>>>>>], "o5"=>["works well", #<struct Node value="o5", next=#<struct Node value="o4", next=#<struct Node value="o2", next=nil, prev=#<struct Node:...>>, prev=#<struct Node:...>>, prev=#<struct Node value="o6", next=#<struct Node:...>, prev=#<struct Node value="o3", next=#<struct Node:...>, prev=#<struct Node value="o4", next=#<struct Node value="o2", next=nil, prev=#<struct Node:...>>, prev=#<struct Node:...>>>>>], "o6"=>["more stuff", #<struct Node value="o6", next=#<struct Node value="o5", next=#<struct Node value="o4", next=#<struct Node value="o2", next=nil, prev=#<struct Node:...>>, prev=#<struct Node:...>>, prev=#<struct Node:...>>, prev=#<struct Node value="o3", next=#<struct Node:...>, prev=#<struct Node value="o4", next=#<struct Node value="o2", next=nil, prev=#<struct Node:...>>, prev=#<struct Node value="o5", next=#<struct Node:...>, prev=#<struct Node:...>>>>>]}