Priority Queue vs Sorting

Prachi
3 min readAug 14, 2021

What is sorting?

Sorting is an approach/algorithm which puts data in a meaningful order. The most common ordering is increasing or decreasing. In programming, we generally have an array on size n which we can sort in any order. There are multiple algorithms for sorting and the best average case time complexity is O(n log n).

What is a priority queue?

--

--