lru here we come
This commit is contained in:
parent
432f88550b
commit
8b4725a628
6 changed files with 34 additions and 3 deletions
8
src/__tests__/LRU.ts
Normal file
8
src/__tests__/LRU.ts
Normal file
|
|
@ -0,0 +1,8 @@
|
|||
import ArrayList from "@code/LRU";
|
||||
|
||||
test("LRU", function () {
|
||||
const lru = new LRU<number>(10);
|
||||
|
||||
lru.
|
||||
});
|
||||
|
||||
5
src/global.d.ts
vendored
5
src/global.d.ts
vendored
|
|
@ -31,3 +31,8 @@ declare type GeneralNode<T> = {
|
|||
value: T;
|
||||
children: GeneralNode<T>[];
|
||||
};
|
||||
|
||||
declare interface ILRU<K, V> {
|
||||
update(key: K, value: V): void;
|
||||
get(key: K): V | undefined;
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue