'Should priority queue be used for simple sorting needs
I have a simple need to sort, where I extract entries from db and sort them on basis of autoincrement id and choose the most recent entry. I was thinking of using Priority Queue for it. Since its efficient to use. I want to write efficient code, but also do not want to overdo for no reason. Should I just do Collections.sort(). In both cases I will have to define comparator for my usecase. That's why I guess complexity-wise both approach will be same. Would appreciate help/advice here.
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
| Solution | Source |
|---|
