This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Jake McQuade // | |
// 10/08/25 // | |
export default class LFUMap<K, V> { | |
private freqs: Map<number, Set<K>> = new Map(); | |
private counts: Map<K, number> = new Map(); | |
private vals: Map<K, V> = new Map(); | |
private minFreq: number = 0; | |
constructor(private capacity: number) {} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class Main { | |
public static void main(String[] args) { | |
int[][] arr = {{2, 1, 0}, {1, 3, 2}, {0, 0, 0}, {4, 5, 6} }; | |
int[][] newArr = resize(arr); | |
for (int r = 0; r < newArr.length; r++) { | |
for (int c = 0; c < newArr[r].length; c++) { | |
System.out.println(newArr[r][c]); | |
} | |
} | |
} |