Q:

Explain the difference between a set and a list. When might you use one or the other

0

Explain the difference between a set and a list. When might you use one or the other?

All Answers

need an explanation for this answer? contact us directly to get an explanation for this answer

A `set` is an associative container while a `list` is a sequential container. Elements in `list` can be sorted by user while elements in `set` is sorted automatically (except unordered version). A `list` can be ordered while a `set` is un-ordered. We can't enforce an arbitrary order by placing an arbitrary element in an arbitrary position in a `set`.

 

need an explanation for this answer? contact us directly to get an explanation for this answer

total answers (1)

Similar questions


need a help?


find thousands of online teachers now