J
John
Suppose you have a large set of strings like for say 1 million
elements.
Say you have a pretty small set of strings like say 20 elements.
You want to find which of the 20 elements are also in the 1 million
element set.
To do this you can iterate through each of the 20 elements and look
them each up in the bigger set.
Now if you have another set say 900,000 elements this is not the best
way to do the
set intersection. Better way is to linearly iterator through both
sets in order keeping the matching
elements.
How does the algorithm set_intersection work ? Does it take into
account the above type of analysis ?
Does the standard tell the running time for set_intersection and what
the algorithm is or is this implementation dependent ?
Thanks.
elements.
Say you have a pretty small set of strings like say 20 elements.
You want to find which of the 20 elements are also in the 1 million
element set.
To do this you can iterate through each of the 20 elements and look
them each up in the bigger set.
Now if you have another set say 900,000 elements this is not the best
way to do the
set intersection. Better way is to linearly iterator through both
sets in order keeping the matching
elements.
How does the algorithm set_intersection work ? Does it take into
account the above type of analysis ?
Does the standard tell the running time for set_intersection and what
the algorithm is or is this implementation dependent ?
Thanks.