We use cookies to ensure you have the best browsing experience on our website. Please read our cookie policy for more information about how we use cookies.
You are always comparing the full deque. You could first test if the new number is the biggest one in the deque now, or if the biggest isn't the one you're popping now nor the new come in... anyway, I can't explain too good, but you can see my code:
Deque-STL
You are viewing a single comment's thread. Return to all comments →
You are always comparing the full deque. You could first test if the new number is the biggest one in the deque now, or if the biggest isn't the one you're popping now nor the new come in... anyway, I can't explain too good, but you can see my code: