We use cookies to ensure you have the best browsing experience on our website. Please read our cookie policy for more information about how we use cookies.
Abstract Classes - Polymorphism
Abstract Classes - Polymorphism
Sort by
recency
|
322 Discussions
|
Please Login in order to post a comment
Take my whiskey neat Solution
Here is an easy solution, correctly done, with head, tail, etc. and also deleting the pointers, not simply removing them from the map 'mp':
It seems like some implementations of get() aren't updating the order of the most recently used. Was this not actually tested for in the test cases?
The list should be updated similar to the following:
1 2 3 4 5 -> get(3) -> 3 1 2 4 5
This passes all tests while correctly maintaining both map and double linked Node list:
hold my beer implementation: