# Memory allocation of priority queues

So, i faced this question during a pratice quiz

i have no idea why " all of the elements are located contiguously in memory " wrong!! My logic is that priority queues are made of binary heaps and binary heaps are made of arrays ( according to introduction to algorithms by CLRS ) , so this means that elements are located contiguously in memory is true for PQ since it's true for arrays so, what am i doing wrong ?!

• Don't use images as main content of your post. This makes your question impossible to search and inaccessible to the visually impaired; we don't like that. Please transcribe text and mathematics. You can use LaTeX). Don't forget to give proper attribution to your sources!
– D.W.
Mar 31, 2021 at 4:29

And that's leaving aside the issue that a binary heap doesn't strictly need to be stored in contiguous memory. Any storage scheme can be used as long as it can be indexed like an array and supports $$O(1)$$ access time.