Could you give me examples of polynomial-time algorithms that must compute a global property over their entire input? A purely illustrative example of this might be a graph algorithm that somehow must count the total number of nodes before computing its final answer.

  • 1
    $\begingroup$ Finding the minimum element of an array or a list? $\endgroup$ – Pseudonym Sep 2 '20 at 0:32

A silly example: Checking if a graph has more than m nodes. :-)

Some more interesting examples:


Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.