Stay organized with collections
Save and categorize content based on your preferences.
C++ Reference: class PriorityQueueWithRestrictedPush
Note: This documentation is automatically generated.
Method |
Clear | Return type: void Clears the queue.
|
IsEmpty | Return type: bool Is the queue empty?
|
Pop | Return type: Element Returns the element with highest priority and remove it from the queue.
IsEmpty() must be false, this condition is DCHECKed.
|
PriorityQueueWithRestrictedPush | |
Push | Return type: void Arguments: Element element, IntegerPriority priority Push a new element in the queue. Its priority must be greater or equal to
the highest priority present in the queue, minus one. This condition is
DCHECKed, and violating it yields erroneous queue behavior in NDEBUG mode.
|
Except as otherwise noted, the content of this page is licensed under the Creative Commons Attribution 4.0 License, and code samples are licensed under the Apache 2.0 License. For details, see the Google Developers Site Policies. Java is a registered trademark of Oracle and/or its affiliates.
Last updated 2024-08-06 UTC.
[null,null,["Last updated 2024-08-06 UTC."],[],["The `PriorityQueueWithRestrictedPush` class in C++ offers methods to manage a priority queue. Key actions include `Clear` to empty the queue, `IsEmpty` to check if it's empty, and `Pop` to retrieve and remove the highest-priority element. `Push` adds a new element with a specified priority, but it enforces a rule: the new priority must be at most one less than the current highest priority. The constructor `PriorityQueueWithRestrictedPush` initializes the class.\n"],null,[]]