coding · GPT-4o · free
I need to pick a data structure for [USE CASE] . Talk me through it without the CS 101 tour. The workload: Reads vs writes ratio: [%] Access pattern: [BY KEY / BY RANGE / BY POSITION / SCAN ALL] Ordering matters? [Y/N — by what] Size range: [N ELEMENTS, P50 vs P99] Duplicates allowed? [Y/N] Concurrent readers/writers? [Y/N] Persistence needed? [Y/N] Language: [LANG] — I care about what's in the stdlib For the top 3 candidates: 1. Big O for insert / lookup / delete / iterate — and the constant factor honestly (cache friendly?) 2. Memory footprint per element in bytes 3. The failure mode at 10x scale 4. When the "textbook" answer loses to a boring array in practice 5. The concurrency story (or "wrap in a mutex") Verdict: pick ONE with the one line justification. Then give me the exact stdlib type / library to use in [LANG], plus the one bench I should run before shipping.
#data-structures #architecture #performance