Content-Length: 248542 | pFad | http://github.com/cp-algorithms/cp-algorithms/issues/1462

F0 Minimum queue removal logic is wrong · Issue #1462 · cp-algorithms/cp-algorithms · GitHub
Skip to content

Minimum queue removal logic is wrong #1462

@buydrpepper

Description

@buydrpepper

Under (method 2):
if (!q.empty() && q.front().second == cnt_removed)
q.pop_front();
cnt_removed++;

Correct me if I'm wrong, but this should either not include the empty check at all, or increment cnt_removed only if the queue is nonempty.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions









      ApplySandwichStrip

      pFad - (p)hone/(F)rame/(a)nonymizer/(d)eclutterfier!      Saves Data!


      --- a PPN by Garber Painting Akron. With Image Size Reduction included!

      Fetched URL: http://github.com/cp-algorithms/cp-algorithms/issues/1462

      Alternative Proxies:

      Alternative Proxy

      pFad Proxy

      pFad v3 Proxy

      pFad v4 Proxy