Difference between std::set and std::priority_queue
Since both std::priority_queue and std::set (and std::multiset ) are data containers that store elements and allow you to access them in an ordered fashion, and have same insertion complexity O(log n) , what are the advantages of using one over the other (or, what kind of situations call for the one or the other?)? While I know that the underlying structures are different, I am not as much interested in the difference in their implementation as I am in the comparison their performance and suitability for various uses. Note: I know about the no-duplicates in a set. That's why I also mentioned