Skip to content

Instantly share code, notes, and snippets.

View jakemcquade's full-sized avatar

Jake McQuade jakemcquade

View GitHub Profile
@jakemcquade
jakemcquade / lfuMap.ts
Last active October 9, 2025 11:36
Type-safe LFU implementation used in a production environment
// 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) {}
@jakemcquade
jakemcquade / main.java
Created March 20, 2025 14:42
AP Computer Science A (AP CSA) Free-Response Question (FRQ)
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]);
}
}
}