|
set: map[interface{}]bool{}, |
You should consider using an empty struct (struct{}) instead of a boolean (bool) as the map value because it won't occupy any memory. You don't actually use the value of the boolean because you check the ok return value from the map access to see if the key is in the set.
Golang_Algorithm/Data_Structure/Set/set.go
Line 23 in a330783
You should consider using an empty struct (
struct{}) instead of a boolean (bool) as the map value because it won't occupy any memory. You don't actually use the value of the boolean because you check theokreturn value from the map access to see if the key is in the set.