The Sunshine: 有space tolerance以及对时间有限制的hashtable实现
关键地方是需要删除时间t-T的entry pointif (map.entrySet().size() >= T) { long lastBucket = ((long) nums[i - T] - Integer.MIN_VALUE) / ((long) t + 1); map.remove(lastBucket); } map.put(bucket, remappedNum);
做一道leetcode题想到的扩展
Read full article from The Sunshine: 有space tolerance以及对时间有限制的hashtable实现
No comments:
Post a Comment