4 ms·
From what kind of programming hellhole do you come from, where using Set instead of List is good advice? Lists are very natural constructs for computers, sets
by enriquto 5y ago
From what kind of programming hellhole do you come from, where using Set instead of List is good advice? Lists are very natural constructs for computers, sets aren't.
- RHSeeger 5y agoA set implies a uniqueness constraint that a list does not. Generally a list is ordered by contract, whereas whether or not a set is ordered depends on the implementation.
- Jtsummers 5y agoSets specify a particular interface but not a particular implementation or backing data structure. You can substitute different implementations (including ones backed by lists, vectors, hash tables, and others) depending on your particular needs.
- nkingsy 5y agoSets generally will give you constant time lookup where lists generally will not.