title: Set Implementation in C++?
body: <p>As per the following link - <a href="http://www.cplusplus.com/reference/set/set/" rel="nofollow">http://www.cplusplus.com/reference/set/set/</a> sets in C++'s STL are typically implemented as Binary Search Trees, I am able to gauge the behavior of the data type in cases such as sets of ints or characters or floats or strings for that matter as in these cases it is easy to see the BST ordering being imposed on set elements, but considering the binary search tree data structure implementation of sets I am not able to visualize how are the following data types implemented using binary search trees:</p>
  
  <ol>
  <li><code>set&lt;vector&lt;int&gt;&gt;</code> or <code>set&lt;vector&lt;string&gt;&gt;</code> or <code>set&lt;vector&lt;double&gt;&gt;</code> or <code>set&lt;list&lt;int&gt;&gt;</code></li>
  <li><code>set&lt;map&lt;int, int&gt;&gt;</code></li>
  <li><code>set&lt;stack&lt;int&gt;&gt;</code></li>
  </ol>
  
  <p>or for that matter many other data types, how is the memory allocated for these types and how is the ordering maintained. </p>
  
  <p>Also I am not able to figure out the following, whenever a new vector is added into the set, does the set data type internally check all the vectors in the set for similarity or all the maps for similarity, these are somethings I am not able to figure out. It would be great if someone can help me visualize these concepts.</p>
  
  <p>Thanks in advance :)</p>