can't you represent the data as a KV pairs?
yeah no problem
then getting an item is always O(1) you don't have to iterate
What if length of array was long?
If it's a performance issue you can split to multiple slices, simulating index
then what you need is a lookup index
Обсуждают сегодня