Hi,
I am a bit confused on the time complexity mentioned for the LRU cache implementation. It says it is O(n).
But doesn’t the data structure illustrated does everything in O(1) time.
e.g deleting, searching etc. on a linked list has O(n) but the implementation has a hash map which points to the doubly linked node address. Hence wouldn’t it take just O(1) ?
Type your question above this line.
Course: https://www.educative.io/collection/10370001/5614097179082752
Lesson: https://www.educative.io/collection/page/10370001/5614097179082752/4899235524247552