Lemmy.eus
  • Communities
  • Create Post
  • Create Community
  • heart
    Support Lemmy
  • search
    Search
  • Login
  • Sign Up
0x4E4F@infosec.pub to Programmer Humor@programming.devEnglish · 2 years ago

Not my problem sort

infosec.pub

message-square
17
link
fedilink
5

Not my problem sort

infosec.pub

0x4E4F@infosec.pub to Programmer Humor@programming.devEnglish · 2 years ago
message-square
17
link
fedilink
  • BatmanAoD@programming.dev
    link
    fedilink
    arrow-up
    1
    ·
    2 years ago

    Reminds me of quantum-bogosort: randomize the list; check if it is sorted. If it is, you’re done; otherwise, destroy this universe.

    • xmunk@sh.itjust.works
      link
      fedilink
      arrow-up
      1
      ·
      2 years ago

      Guaranteed to sort the list in nearly instantaneous time and with absolutely no downsides that are capable of objecting.

      • frezik@midwest.social
        link
        fedilink
        arrow-up
        0
        ·
        2 years ago

        You still have to check that it’s sorted, which is O(n).

        We’ll also assume that destroying the universe takes constant time.

        • BatmanAoD@programming.dev
          link
          fedilink
          arrow-up
          1
          ·
          2 years ago

          In the universe where the list is sorted, it doesn’t actually matter how long the destruction takes!

          • groet@feddit.org
            link
            fedilink
            English
            arrow-up
            0
            ·
            2 years ago

            It actually takes a few trillion years but its fine because we just stop considering the “failed” universes because they will be gone soon™ anyway.

            • MBM@lemmings.world
              link
              fedilink
              arrow-up
              1
              ·
              2 years ago

              Eh, trillion is a constant

    • SubArcticTundra@lemmy.ml
      link
      fedilink
      arrow-up
      0
      ·
      2 years ago

      What library are you using for that?

      • jcg@halubilo.social
        link
        fedilink
        arrow-up
        0
        ·
        2 years ago

        is-sorted and a handful of about 300 other npm packages. Cloning the repo and installing takes about 16 hours but after that you’re pretty much good for the rest of eternity

        • Swedneck@discuss.tchncs.de
          link
          fedilink
          arrow-up
          0
          ·
          2 years ago

          that explains why it took god 7 days to make the universe

          • onlinepersona@programming.dev
            link
            fedilink
            arrow-up
            0
            arrow-down
            1
            ·
            2 years ago

            We still suffer from the runtime errors that could’ve been caught at compilation time.

            Anti Commercial-AI license

Programmer Humor@programming.dev

programmer_humor@programming.dev

Subscribe from Remote Instance

Create a post
You are not logged in. However you can subscribe from another Fediverse account, for example Lemmy or Mastodon. To do this, paste the following into the search field of your instance: !programmer_humor@programming.dev

Welcome to Programmer Humor!

This is a place where you can post jokes, memes, humor, etc. related to programming!

For sharing awful code theres also Programming Horror.

Rules

  • Keep content in english
  • No advertisements
  • Posts must be related to programming or programmer topics
Visibility: Public
globe

This community can be federated to other instances and be posted/commented in by their users.

  • 2.32K users / day
  • 3.43K users / week
  • 7.32K users / month
  • 17.5K users / 6 months
  • 3 local subscribers
  • 32K subscribers
  • 2.2K Posts
  • 61.2K Comments
  • Modlog
  • mods:
  • Feyter@programming.dev
  • adr1an@programming.dev
  • BurningTurtle@programming.dev
  • Pierre-Yves Lapersonne@programming.dev
  • BE: 0.19.15
  • Modlog
  • Instances
  • Docs
  • Code
  • join-lemmy.org