Pergunta de entrevista da empresa ServiceNow

LRU Cache (LeetCode #146) Describe how to implement a LRU Cache.

Resposta da entrevista

Sigiloso

21 de abr. de 2024

Use an ordered hashmap (OrderedDict in Python, Map in JavaScript). Alternatively, use a hashmap and a doubly-linked list.