1. Home
  2. Computer Science MCQs
  3. Algorithms and Data Structures
  4. Which data-structure is best for LRU cache with O(1) ops?

Added 14 Sep 2025

Which data-structure is best for LRU cache with O(1) ops?

  1. HashMap
  2. Deque
  3. HashMap + DoublyLinkedList Correct answer
  4. TreeMap

Correct answer

C. HashMap + DoublyLinkedList

16 views

MCQSEXAM

Explanation

Hash-map + doubly-linked list gives O(1) get/put.

Reference

https://leetcode.com/problems/lru-cache/

Doubts & discussion

Not sure why the answer is C? Ask here and get an explanation.

Ask a doubt about this MCQ

Shown after review. No links please.

More Algorithms and Data Structures MCQs

Practise all Algorithms and Data Structures MCQs

Similar MCQs