3 ms·
If you want it to be performant, a linked list is better than a slice. Then in your map you store structs that have both the stores value and a pointer to the c
by lemoncucumber 8y ago
If you want it to be performant, a linked list is better than a slice. Then in your map you store structs that have both the stores value and a pointer to the corresponding node in the linked list. That way random deletions are constant time since they don’t require copying the slice.