Just beginning my journey of learning data structures and algorithms, and I’m getting hung up on the fact that there is information everywhere about this kind of stuff with different nicknames for each data structure. But in layman’s terms are all queues in fact priority queues, the priority bit being exactly what makes them so special?
I tried googling are all queues priority queues and I got recommended to stack overflow’s massive hive mind of information.
>Solution :
The answer is both Yes and No. They are the same theoretical concept, but are implemented with completely unrelated data structures.
A generic priority queue requires a somewhat complex "heap" sort of data structure. However, a insertion-order-queue can use a totally unrelated "list-like" data structure, which is far faster. So while they are the same general concept, they usually use totally unrelated data structures.
You see this in other places too. In layman’s term, a "list" is a general concept. But C++ calls this concept "SequenceContainer", and then very confusingly named their SequenceContainer linked list data structure std::list. But in layman’s terms, std::vector and std::deque and std::array are also lists, despite being totally unrelated data structures.