Set and memory

does using a set to store integers take more space than using an array to do so?
Yes. As far as I know std::set is usually implemented as a red-black tree.
Trees are made of nodes, which are linked together. So each node contains the extra linking information, besides the actual integer.

Arrays are pretty much a contiguous block of memory containing the bare data.
Topic archived. No new replies allowed.