Skip to content

Instantly share code, notes, and snippets.

View ajLapid718's full-sized avatar

Allan James Lapid ajLapid718

View GitHub Profile
@tpae
tpae / LRUCache.js
Created November 21, 2016 08:16
super simple JavaScript Implementation of LRUCache
// LRUCache.js - super simple JavaScript Implementation
// LRU stands for "Least Recently Used"
// https://en.wikipedia.org/wiki/Cache_replacement_policies#LRU
// -----------------------------------------
function LRUNode(key) {
this.key = key;
this.next = this.prev = null;
}