rajutsav1234's blog

By rajutsav1234, history, 3 years ago, In English

which is faster:

  • Sorting a vector
  • Or using a priority queue
  • Vote: I like it
  • +3
  • Vote: I do not like it

»
3 years ago, # |
Rev. 2   Vote: I like it +12 Vote: I do not like it

Based on the content written at the page 45 of Competitive Programmer's Handbook, sorting is usually faster for solving the problem. Although the discussion on the page is about set vs unordered_set vs sorting, I believe similar arguments would hold true in case of priority_queue also.