#create an set from vector (time complexity)
28 messages · Page 1 of 1 (latest)
When your question is answered use !solved to mark the question as resolved.
Remember to ask specific questions, provide necessary details, and reduce your question to its simplest form. For tips on how to ask a good question run !howto ask.
You have to copy the elements element by element one time, thus O(N)
set::insert has a time complexity of log N
so it would be O(N log N)
tfw you forget how sets work
wait
unordered_set is probably a hash map
no
let me think about this
yea, what happens to a mf when you never need to think about complexities
std::set is a tree, std::unordered_set is a hash map
so creating an unordered_set from a vector is potentially O(n) but creating a set is O(n log n)
This still leads to my question, why does the standard comittee give these awful names to this stuff
why not just call it std::Tree
lots of things are trees ._.
heap is a tree
std::map is a tree
"tree" is a useless name, might as well just call it "structure"
Yea, I'm just wrong here aren't I 😛
This question thread is being automatically closed. If your question is not answered feel free to bump the post or re-ask. Take a look at !howto ask for tips on improving your question.