求leetcode LRU Java 解法# JobHunting - 待字闺中
f*3
1 楼
希望用java.util的HashMap和LinkedList,搞了两天没搞出来,太弱了。自己写的
Linked List没有问题,但是这个自带的LinkedList没找到给定node reference, O(1)
删除的方法,估计要用ListIterator? 然后这些ListIterator存在HashMap里? 不然会
超时。
C++反正本来也是自己写LinkedList,没有问题,但是这个用standard java
LinkedList就是搞不定啊...
Linked List没有问题,但是这个自带的LinkedList没找到给定node reference, O(1)
删除的方法,估计要用ListIterator? 然后这些ListIterator存在HashMap里? 不然会
超时。
C++反正本来也是自己写LinkedList,没有问题,但是这个用standard java
LinkedList就是搞不定啊...