Abstract Classes - Polymorphism

  • + 0 comments

    Thiiiis feels like a poorly-designed problem. In addition to the lack of polymorphism mentioned in the top voted comment, the question presents the cache as a way to avoid doing expensive lookups, which, okay, a linked list is expensive to sort through. But then, it provides you a std::map mp, which lets you look up nodes quickly anyways?

    std::map can't be used for implementing LRU as-is since it doesn't store any information about recency, unless I'm missing something? It's not clear from the description, either:

    "mp - Map the key to the node in the linked list"

    That's a request, not a description.