Hi all, have been bugging my mind on this, anyone knows which way to best implement node size? I need a dynamic array of sort to contain these info
So which container is best for this? Arrays? Multimaps, vector, class, struct?
(But I'll make you an example with int, maybe it will help)
Let's say you want to store the following values (from some input or from a file): 3, 1, 2, 4, 1.
If the given order is important, vector is what you want (they will hold 3, 1, 2, 4, 1).
If you need sorted data set is what you want (it will store 1, 2, 3, 4). Notice that 1 is not repeated.
If you need sorted data (and they can be repeated) multiset will be (1, 1, 2, 3, 4)
If you use maps you are actually using a KEY to sort and a values (example is with phone numbers and names: phone numbers will be the key, since they don't have repeated values, while multiple "john doe" can exist)
If you use multimaps you alow for repeated keys (if it helps, think about a (multi)set as a (multi)map in which key and values are the same).
Use class and struct (which are more or less the same) if what you get from below is not enough and you need more customization