• dfyx@lemmy.helios42.de
    link
    fedilink
    English
    arrow-up
    3
    ·
    edit-2
    8 days ago

    One important addendum: complexity classes always consider how hard a problem is depending on the input size. Sorting is in P (usually O(n*log(n)), so one of the easiest problems overall) but given a few trillion inputs, it would be pretty much impossible to solve on consumer hardware. On the other hand, problems like 3-sat, the knapsack problem or travelling salesman are all NP-hard but with small enough inputs (up to a few dozen or so), they are easy to solve, even with pen and paper and are even regularly included in puzzle books.