Skip to content

Instantly share code, notes, and snippets.

View achernoprudov's full-sized avatar
🏠
Working from home

Andrei Chernoprudov achernoprudov

🏠
Working from home
View GitHub Profile
@achernoprudov
achernoprudov / LruCache.swift
Created May 12, 2019 09:02
LRU Cache implementation. Swift version.
class LruCache<K: Hashable, V> {
private class Entity<V> {
let value: V
let key: K
var left: Entity<V>?
var right: Entity<V>?
init(value: V, key: K) {
self.value = value