title: Efficient output data structure in C++
body: <p>I am working on the Interval Partitioning problem (eg: <a href="http://kartikkukreja.wordpress.com/2013/09/26/interval-partitioning-problem/" rel="nofollow">http://kartikkukreja.wordpress.com/2013/09/26/interval-partitioning-problem/</a>) where I have to write the optimal schedules to an output file. I am currently using a map> to store the intervals assigned to several partitions. The first int denoted the partition number and the vector corresponding to it denotes the intervals assigned to that partition. </p>
  
  <p>To write the contents out to a file, I am iterating through all the keys of the map and writing out the vector for each key. Is this the most efficient data structure to store the data (partition_number,intervals) ? or Can I use something other than a map so that I can write the output in a much faster way ?</p>