ℹ️ Skipped - page is already crawled
| Filter | Status | Condition | Details |
|---|---|---|---|
| HTTP status | PASS | download_http_code = 200 | HTTP 200 |
| Age cutoff | FAIL | download_stamp > now() - 6 MONTH | 6.6 months ago |
| History drop | PASS | isNull(history_drop_reason) | No drop reason |
| Spam/ban | PASS | fh_dont_index != 1 AND ml_spam_score = 0 | ml_spam_score=0 |
| Canonical | PASS | meta_canonical IS NULL OR = '' OR = src_unparsed | Not set |
| Property | Value |
|---|---|
| URL | https://cs.stackexchange.com/questions/91442/correct-term-for-a-priority-queue-with-unique-elements |
| Last Crawled | 2025-09-22 09:20:20 (6 months ago) |
| First Indexed | 2019-05-24 11:29:21 (6 years ago) |
| HTTP Status Code | 200 |
| Meta Title | data structures - Correct term for a priority queue with unique elements - Computer Science Stack Exchange |
| Meta Description | null |
| Meta Canonical | null |
| Boilerpipe Text | I don't know of a name for the abstract data structure. There is a well-established implementation of what you describe, though: treaps , a combination of BST and heap (i.e. priority queue). This is with priority and value/key being different things, though. If priority and value are the same, use any priority queue and add uniqueness, i.e. by combining it with a set/dictionary data structure. (Treaps degenerate to sorted lists in this case.) |
| Markdown | [Skip to main content](https://cs.stackexchange.com/questions/91442/correct-term-for-a-priority-queue-with-unique-elements#content)
#### Stack Exchange Network
Stack Exchange network consists of 183 Q\&A communities including [Stack Overflow](https://stackoverflow.com/), the largest, most trusted online community for developers to learn, share their knowledge, and build their careers.
[Visit Stack Exchange](https://stackexchange.com/)
1. - [Tour Start here for a quick overview of the site](https://cs.stackexchange.com/tour)
- [Help Center Detailed answers to any questions you might have](https://cs.stackexchange.com/help)
- [Meta Discuss the workings and policies of this site](https://cs.meta.stackexchange.com/)
- [About Us Learn more about Stack Overflow the company, and our products](https://stackoverflow.co/)
2. ### [current community](https://cs.stackexchange.com/)
- [Computer Science](https://cs.stackexchange.com/)
[help](https://cs.stackexchange.com/help) [chat](https://chat.stackexchange.com/?tab=all&sort=active)
- [Computer Science Meta](https://cs.meta.stackexchange.com/)
### your communities
[Sign up](https://cs.stackexchange.com/users/signup?ssrc=site_switcher&returnurl=https%3A%2F%2Fcs.stackexchange.com%2Fquestions%2F91442%2Fcorrect-term-for-a-priority-queue-with-unique-elements) or [log in](https://cs.stackexchange.com/users/login?ssrc=site_switcher&returnurl=https%3A%2F%2Fcs.stackexchange.com%2Fquestions%2F91442%2Fcorrect-term-for-a-priority-queue-with-unique-elements) to customize your list.
### [more stack exchange communities](https://stackexchange.com/sites)
[company blog](https://stackoverflow.blog/)
3. [Log in](https://cs.stackexchange.com/users/login?ssrc=head&returnurl=https%3A%2F%2Fcs.stackexchange.com%2Fquestions%2F91442%2Fcorrect-term-for-a-priority-queue-with-unique-elements)
4. [Sign up](https://cs.stackexchange.com/users/signup?ssrc=head&returnurl=https%3A%2F%2Fcs.stackexchange.com%2Fquestions%2F91442%2Fcorrect-term-for-a-priority-queue-with-unique-elements)
[](https://cs.stackexchange.com/)
1. 1. [Home](https://cs.stackexchange.com/)
2. [Questions](https://cs.stackexchange.com/questions)
3. [Unanswered](https://cs.stackexchange.com/unanswered)
4. [AI Assist Labs](https://stackoverflow.ai/)
5. [Tags](https://cs.stackexchange.com/tags)
6. [Chat](https://chat.stackexchange.com/rooms/158962/stack-exchange-lobby)
7. [Users](https://cs.stackexchange.com/users)
8. [Companies](https://stackoverflow.com/jobs/companies?so_medium=cs&so_source=SiteNav)
2. Teams

Ask questions, find answers and collaborate at work with Stack Overflow for Teams.
[Try Teams for free](https://stackoverflowteams.com/teams/create/free/?utm_medium=referral&utm_source=cs-community&utm_campaign=side-bar&utm_content=explore-teams) [Explore Teams](https://stackoverflow.co/teams/?utm_medium=referral&utm_source=cs-community&utm_campaign=side-bar&utm_content=explore-teams)
3. [Teams]()
4. Ask questions, find answers and collaborate at work with Stack Overflow for Teams. [Explore Teams](https://stackoverflow.co/teams/?utm_medium=referral&utm_source=cs-community&utm_campaign=side-bar&utm_content=explore-teams-compact)
**Teams**
Q\&A for work
Connect and share knowledge within a single location that is structured and easy to search.
[Learn more about Teams](https://stackoverflow.co/teams/)
# [Correct term for a priority queue with unique elements](https://cs.stackexchange.com/questions/91442/correct-term-for-a-priority-queue-with-unique-elements)
[Ask Question](https://cs.stackexchange.com/questions/ask)
Asked
7 years, 4 months ago
Modified [2 years ago](https://cs.stackexchange.com/questions/91442/correct-term-for-a-priority-queue-with-unique-elements?lastactivity "2023-08-25 18:15:09Z")
Viewed 2k times
1
\$\\begingroup\$
Is there a standard term for a priority queue which can only hold a single occurrence of any element? This would be a priority queue for which operations such as "raise the priority of element `x` to the new value `p`" would make sense.
In this kind of an abstract container, if you insert some element ("key", but not in the sense of "priority key") with some priority, you cannot insert it again until it is extracted, but you can update its priority.
I would also like to know if there is some established interface for this kind of a priority queues.
- [data-structures](https://cs.stackexchange.com/questions/tagged/data-structures "show questions tagged 'data-structures'")
- [terminology](https://cs.stackexchange.com/questions/tagged/terminology "show questions tagged 'terminology'")
- [priority-queues](https://cs.stackexchange.com/questions/tagged/priority-queues "show questions tagged 'priority-queues'")
[Share](https://cs.stackexchange.com/q/91442 "Short permalink to this question")
Cite
[Improve this question](https://cs.stackexchange.com/posts/91442/edit)
Follow
[edited May 3, 2018 at 9:29](https://cs.stackexchange.com/posts/91442/revisions "show all edits to this post")
Alexey[Alexey](https://cs.stackexchange.com/users/27348/alexey)
asked May 2, 2018 at 20:24
[](https://cs.stackexchange.com/users/27348/alexey)
[Alexey](https://cs.stackexchange.com/users/27348/alexey)Alexey
25111 silver badge1313 bronze badges
\$\\endgroup\$
5
- 1
\$\\begingroup\$ Not that I know of. That operation makes sense even without that condition (you just need a way to identify the element you are talking about, which could be done e.g. with a pointer or in some other way). \$\\endgroup\$
D.W.
– [D.W.](https://cs.stackexchange.com/users/755/d-w "168,434 reputation") ♦
2018-05-02 20:37:56 +00:00
Commented May 2, 2018 at 20:37
- \$\\begingroup\$ IMO it makes little sense to use a PQ to store and move around elements rather than pointers in such case. If i can identify elements in the PQ, it means that they are unique somehow. \$\\endgroup\$
Alexey
– [Alexey](https://cs.stackexchange.com/users/27348/alexey "251 reputation")
2018-05-02 20:51:15 +00:00
Commented May 2, 2018 at 20:51
- 1
\$\\begingroup\$ [ceur-ws.org/Vol-1525/paper-13.pdf](http://ceur-ws.org/Vol-1525/paper-13.pdf) \$\\endgroup\$
HEKTO
– [HEKTO](https://cs.stackexchange.com/users/11850/hekto "3,183 reputation")
2018-05-02 21:37:20 +00:00
Commented May 2, 2018 at 21:37
- \$\\begingroup\$ "single occurrence of any element" - based on what? Do you assume that all the elements have a *key*, which must be unique all over the queue? Can you please clarify? \$\\endgroup\$
HEKTO
– [HEKTO](https://cs.stackexchange.com/users/11850/hekto "3,183 reputation")
2018-05-02 21:47:07 +00:00
Commented May 2, 2018 at 21:47
- \$\\begingroup\$ @D.W., i've realised that it can indeed be more efficient to keep the data associated to the key in this "keyed" priority queue, rather than in a separate key-value store (less search-by-key operations to perform). Maybe i will go with "priority queue with unique keys" or "indexed priority queue"... \$\\endgroup\$
Alexey
– [Alexey](https://cs.stackexchange.com/users/27348/alexey "251 reputation")
2018-05-03 18:26:40 +00:00
Commented May 3, 2018 at 18:26
[Add a comment](https://cs.stackexchange.com/questions/91442/correct-term-for-a-priority-queue-with-unique-elements "Use comments to ask for more information or suggest improvements. Avoid answering questions in comments.") \|
## 3 Answers 3
Sorted by:
[Reset to default](https://cs.stackexchange.com/questions/91442/correct-term-for-a-priority-queue-with-unique-elements?answertab=scoredesc#tab-top)
3
\$\\begingroup\$
I don't know of a name for the abstract data structure.
There is a well-established implementation of what you describe, though: *treaps*, a combination of BST and heap (i.e. priority queue). This is with priority and value/key being different things, though.
If priority and value are the same, use any priority queue and add uniqueness, i.e. by combining it with a set/dictionary data structure. (Treaps degenerate to sorted lists in this case.)
[Share](https://cs.stackexchange.com/a/91457 "Short permalink to this answer")
Cite
[Improve this answer](https://cs.stackexchange.com/posts/91457/edit)
Follow
answered May 3, 2018 at 8:53
[](https://cs.stackexchange.com/users/98/raphael)
[Raphael](https://cs.stackexchange.com/users/98/raphael)Raphael
73\.3k3131 gold badges183183 silver badges403403 bronze badges
\$\\endgroup\$
0
[Add a comment](https://cs.stackexchange.com/questions/91442/correct-term-for-a-priority-queue-with-unique-elements "Use comments to ask for more information or suggest improvements. Avoid comments like “+1” or “thanks”.") \|
1
\$\\begingroup\$
Does `PriorityQueueSet` sounds good? A sample signature of Java implementation
/\*\*
- A priority queue that also maintains a set of unique entries.
- @param type of the key to identify the entry
- @param type of the entry
- keyExtractor is used to extract the key from the entry
- valueComparator is used to sort the entries in the queue
\*/
public class PriorityQueueSet\<K, V\> extends PriorityQueue
[Share](https://cs.stackexchange.com/a/161768 "Short permalink to this answer")
Cite
[Improve this answer](https://cs.stackexchange.com/posts/161768/edit)
Follow
answered Aug 25, 2023 at 18:15
[](https://cs.stackexchange.com/users/162646/sandeep-thar)
[Sandeep Thar](https://cs.stackexchange.com/users/162646/sandeep-thar)Sandeep Thar
11122 bronze badges
\$\\endgroup\$
1
- \$\\begingroup\$ Interesting idea. Maybe just `PrioritySet` then... \$\\endgroup\$
Alexey
– [Alexey](https://cs.stackexchange.com/users/27348/alexey "251 reputation")
2023-08-25 18:18:16 +00:00
Commented Aug 25, 2023 at 18:18
[Add a comment](https://cs.stackexchange.com/questions/91442/correct-term-for-a-priority-queue-with-unique-elements "Use comments to ask for more information or suggest improvements. Avoid comments like “+1” or “thanks”.") \|
0
\$\\begingroup\$
Let me clarify first that by "unique elements" I meant elements unique by their identities, not by their "values." (In case of mutable objects, distinct mutable objects may at some moment have identical "values.") The identities of elements have to be maintained while the elements are being moving inside the priority queue implementation.
I've decided to go with *indexed priority queue*.
It turns out that a similar term is used in [*Algorithms*](https://algs4.cs.princeton.edu/home/) textbook by Robert Sedgewick and Kevin Wayne: they call it [*index priority queue*](https://algs4.cs.princeton.edu/24pq/).
I've also checked out [*Algorithm Design*](https://archive.org/details/AlgorithmDesign1stEditionByJonKleinbergAndEvaTardos2005PDF/page/n90) by Jon Kleinberg et Éva Tardos and [*Introduction to Algorithms*](https://mitpress.mit.edu/books/introduction-algorithms-third-edition) by Cormen et al, but they do not use any special term for this kind of a PQ, and just keep calling it a priority queue.
[Share](https://cs.stackexchange.com/a/105831 "Short permalink to this answer")
Cite
[Improve this answer](https://cs.stackexchange.com/posts/105831/edit)
Follow
[edited Mar 20, 2019 at 16:16](https://cs.stackexchange.com/posts/105831/revisions "show all edits to this post")
answered Mar 20, 2019 at 13:43
[](https://cs.stackexchange.com/users/27348/alexey)
[Alexey](https://cs.stackexchange.com/users/27348/alexey)Alexey
25111 silver badge1313 bronze badges
\$\\endgroup\$
[Add a comment](https://cs.stackexchange.com/questions/91442/correct-term-for-a-priority-queue-with-unique-elements "Use comments to ask for more information or suggest improvements. Avoid comments like “+1” or “thanks”.") \|
Start asking to get answers
Find the answer to your question by asking.
[Ask question](https://cs.stackexchange.com/questions/ask)
Explore related questions
- [data-structures](https://cs.stackexchange.com/questions/tagged/data-structures "show questions tagged 'data-structures'")
- [terminology](https://cs.stackexchange.com/questions/tagged/terminology "show questions tagged 'terminology'")
- [priority-queues](https://cs.stackexchange.com/questions/tagged/priority-queues "show questions tagged 'priority-queues'")
See similar questions with these tags.
- Featured on Meta
- [Introducing a new proactive anti-spam measure](https://meta.stackexchange.com/questions/412705/introducing-a-new-proactive-anti-spam-measure)
- [Spevacus has joined us as a Community Manager](https://meta.stackexchange.com/questions/412667/spevacus-has-joined-us-as-a-community-manager)
- [stackoverflow.ai - rebuilt for attribution](https://meta.stackexchange.com/questions/412386/stackoverflow-ai-rebuilt-for-attribution)
- [Community Asks Sprint Announcement - September 2025](https://meta.stackexchange.com/questions/412384/community-asks-sprint-announcement-september-2025)
#### Related
[50](https://cs.stackexchange.com/questions/524/does-there-exist-a-priority-queue-with-o1-extracts "Question score (upvotes - downvotes)")
[Does there exist a priority queue with \$O(1)\$ extracts?](https://cs.stackexchange.com/questions/524/does-there-exist-a-priority-queue-with-o1-extracts)
[19](https://cs.stackexchange.com/questions/7890/priority-queue-for-partially-ordered-priorities-with-infima "Question score (upvotes - downvotes)")
[Priority queue for partially ordered priorities with infima](https://cs.stackexchange.com/questions/7890/priority-queue-for-partially-ordered-priorities-with-infima)
[1](https://cs.stackexchange.com/questions/12637/priority-queue-with-ubounded-number-of-elements-i-e-with-dynamic-storage "Question score (upvotes - downvotes)")
[Priority queue with ubounded number of elements (i.e., with dynamic storage)](https://cs.stackexchange.com/questions/12637/priority-queue-with-ubounded-number-of-elements-i-e-with-dynamic-storage)
[1](https://cs.stackexchange.com/questions/68538/how-to-classify-simple-priority-queue-algorithm "Question score (upvotes - downvotes)")
[How to classify simple priority queue algorithm](https://cs.stackexchange.com/questions/68538/how-to-classify-simple-priority-queue-algorithm)
[0](https://cs.stackexchange.com/questions/75236/what-is-the-type-of-linked-list-where-order-doesnt-matter "Question score (upvotes - downvotes)")
[What is the type of linked list where order doesn't matter](https://cs.stackexchange.com/questions/75236/what-is-the-type-of-linked-list-where-order-doesnt-matter)
[0](https://cs.stackexchange.com/questions/81887/bucket-priority-queues-with-large-integers-for-o1-insert-and-extractmin "Question score (upvotes - downvotes)")
[Bucket Priority Queues with large integers for \$O(1)\$ insert and extract~min?](https://cs.stackexchange.com/questions/81887/bucket-priority-queues-with-large-integers-for-o1-insert-and-extractmin)
[1](https://cs.stackexchange.com/questions/108783/priority-queue-with-a-buffer-for-delayed-insertion-and-other-tweaks "Question score (upvotes - downvotes)")
[Priority queue with a buffer for delayed insertion and other tweaks](https://cs.stackexchange.com/questions/108783/priority-queue-with-a-buffer-for-delayed-insertion-and-other-tweaks)
[1](https://cs.stackexchange.com/questions/150125/indexed-priority-queue-change-key "Question score (upvotes - downvotes)")
[Indexed Priority Queue change key](https://cs.stackexchange.com/questions/150125/indexed-priority-queue-change-key)
#### [Hot Network Questions](https://stackexchange.com/questions?tab=hot)
- [What is a numerically practical and safe measure of dispersion of a data set?](https://stats.stackexchange.com/questions/670366/what-is-a-numerically-practical-and-safe-measure-of-dispersion-of-a-data-set)
- [Can I ask to postpone publication after acceptance?](https://academia.stackexchange.com/questions/221385/can-i-ask-to-postpone-publication-after-acceptance)
- [Expected losses: My math and my program don't agree. Not sure which one is wrong](https://math.stackexchange.com/questions/5097463/expected-losses-my-math-and-my-program-dont-agree-not-sure-which-one-is-wrong)
- [How to perform sed replacement from the rule file only on certain lines?](https://unix.stackexchange.com/questions/799831/how-to-perform-sed-replacement-from-the-rule-file-only-on-certain-lines)
- [What is the practical impact of recognising another state?](https://politics.stackexchange.com/questions/93583/what-is-the-practical-impact-of-recognising-another-state)
- [Do the Matrix movies take place in our present or our future?](https://scifi.stackexchange.com/questions/299291/do-the-matrix-movies-take-place-in-our-present-or-our-future)
- [Should you publish a new result as an appendum?](https://academia.stackexchange.com/questions/221401/should-you-publish-a-new-result-as-an-appendum)
- [Was it normal to refer to God as 'the Father' during the time of Jesus?](https://christianity.stackexchange.com/questions/108808/was-it-normal-to-refer-to-god-as-the-father-during-the-time-of-jesus)
- [How do I make this math equation to fit in page](https://tex.stackexchange.com/questions/751425/how-do-i-make-this-math-equation-to-fit-in-page)
- [Turning Goldberg Graphs/Skeletons into Goldberg Polyhedrons (possibly skew)](https://mathematica.stackexchange.com/questions/315441/turning-goldberg-graphs-skeletons-into-goldberg-polyhedrons-possibly-skew)
- [Shelf life of homemade vegetable stock stored in the fridge](https://cooking.stackexchange.com/questions/133133/shelf-life-of-homemade-vegetable-stock-stored-in-the-fridge)
- [Difficult triple stops in Grand Caprice (Erlkönig) for Violin Solo Op. 26: measure 9](https://music.stackexchange.com/questions/141440/difficult-triple-stops-in-grand-caprice-erlk%C3%B6nig-for-violin-solo-op-26-measu)
- [Who are “those” who do not receive the mysteries of the Kingdom of Heaven?](https://hermeneutics.stackexchange.com/questions/108428/who-are-those-who-do-not-receive-the-mysteries-of-the-kingdom-of-heaven)
- [What species of plum is this? (France, mid-September)](https://biology.stackexchange.com/questions/117943/what-species-of-plum-is-this-france-mid-september)
- [What was the first video game to feature a fake credits sequence?](https://gaming.stackexchange.com/questions/413464/what-was-the-first-video-game-to-feature-a-fake-credits-sequence)
- [How can I draw this box in 3D ? I am unhappy with that I have](https://tex.stackexchange.com/questions/751445/how-can-i-draw-this-box-in-3d-i-am-unhappy-with-that-i-have)
- [How to import the linked FBX with its animations?](https://blender.stackexchange.com/questions/339089/how-to-import-the-linked-fbx-with-its-animations)
- [What is this circuit breaker on the outside of my house for?](https://diy.stackexchange.com/questions/323175/what-is-this-circuit-breaker-on-the-outside-of-my-house-for)
- [Why does the Equality Act 2010 contain a provision mandating its amendment?](https://law.stackexchange.com/questions/110968/why-does-the-equality-act-2010-contain-a-provision-mandating-its-amendment)
- [Interpretation of slope coefficient when a variable appears in multiple powers](https://stats.stackexchange.com/questions/670325/interpretation-of-slope-coefficient-when-a-variable-appears-in-multiple-powers)
- [possible counter example to the following claim (power sets of topological spaces)](https://math.stackexchange.com/questions/5097466/possible-counter-example-to-the-following-claim-power-sets-of-topological-space)
- [Linear rheostat - where lies a trick of a sliding contact with isolated wire?](https://electronics.stackexchange.com/questions/755728/linear-rheostat-where-lies-a-trick-of-a-sliding-contact-with-isolated-wire)
- [Check whether a binary tree is symmetric](https://codereview.stackexchange.com/questions/298186/check-whether-a-binary-tree-is-symmetric)
- [What is this theorem in Egorov 1981?](https://mathoverflow.net/questions/500620/what-is-this-theorem-in-egorov-1981)
[more hot questions](https://cs.stackexchange.com/questions/91442/correct-term-for-a-priority-queue-with-unique-elements)
[Question feed](https://cs.stackexchange.com/feeds/question/91442 "Feed of this question and its answers")
# Subscribe to RSS
Question feed
To subscribe to this RSS feed, copy and paste this URL into your RSS reader.

##### [Computer Science](https://cs.stackexchange.com/)
- [Tour](https://cs.stackexchange.com/tour)
- [Help](https://cs.stackexchange.com/help)
- [Chat](https://chat.stackexchange.com/?tab=all&sort=active)
- [Contact](https://cs.stackexchange.com/contact)
- [Feedback](https://cs.meta.stackexchange.com/)
##### [Company](https://stackoverflow.co/)
- [Stack Overflow](https://stackoverflow.com/)
- [Teams](https://stackoverflow.co/teams/)
- [Advertising](https://stackoverflow.co/advertising/)
- [Talent](https://stackoverflow.co/advertising/employer-branding/)
- [About](https://stackoverflow.co/)
- [Press](https://stackoverflow.co/company/press/)
- [Legal](https://stackoverflow.com/legal)
- [Privacy Policy](https://stackoverflow.com/legal/privacy-policy)
- [Terms of Service](https://stackoverflow.com/legal/terms-of-service/public)
- Cookie Settings
- [Cookie Policy](https://policies.stackoverflow.co/stack-overflow/cookie-policy)
##### [Stack Exchange Network](https://stackexchange.com/)
- [Technology](https://stackexchange.com/sites#technology)
- [Culture & recreation](https://stackexchange.com/sites#culturerecreation)
- [Life & arts](https://stackexchange.com/sites#lifearts)
- [Science](https://stackexchange.com/sites#science)
- [Professional](https://stackexchange.com/sites#professional)
- [Business](https://stackexchange.com/sites#business)
- [API](https://api.stackexchange.com/)
- [Data](https://data.stackexchange.com/)
- [Blog](https://stackoverflow.blog/?blb=1)
- [Facebook](https://www.facebook.com/officialstackoverflow/)
- [Twitter](https://twitter.com/stackoverflow)
- [LinkedIn](https://linkedin.com/company/stack-overflow)
- [Instagram](https://www.instagram.com/thestackoverflow)
Site design / logo © 2025 Stack Exchange Inc; user contributions licensed under [CC BY-SA](https://stackoverflow.com/help/licensing) . rev 2025.9.19.34211 |
| Readable Markdown | null |
| Shard | 18 (laksa) |
| Root Hash | 8045678284012640218 |
| Unparsed URL | com,stackexchange!cs,/questions/91442/correct-term-for-a-priority-queue-with-unique-elements s443 |