We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent b2e8114 commit d9209e5Copy full SHA for d9209e5
src/dataStructures/queue/MonotonicQueue.java
@@ -61,6 +61,9 @@ public T max() {
61
* Removal will only be done all representation of the object has been accounted for.
62
*/
63
public T pop() {
64
+ if (dq.isEmpty()) {
65
+ return null;
66
+ }
67
Pair<T> node = dq.peek();
68
if (node.countDeleted > 0) {
69
node.countDeleted -= 1;
0 commit comments