Lemmy for LUS
  • Communities
  • Create Post
  • heart
    Support Lemmy
  • search
    Search
  • Login
  • Sign Up
@0x4E4F@infosec.pub to Programmer Humor@programming.devEnglish • 6 months ago

Not my problem sort

infosec.pub

message-square
70
fedilink
753

Not my problem sort

infosec.pub

@0x4E4F@infosec.pub to Programmer Humor@programming.devEnglish • 6 months ago
message-square
70
fedilink
  • @xmunk@sh.itjust.works
    link
    fedilink
    96•6 months 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
      48•6 months 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
        43•6 months 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
          13•6 months 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
            8•6 months ago

            Eh, trillion is a constant

        • @FiskFisk33@startrek.website
          link
          fedilink
          8•6 months ago

          amortized O(0)

      • YonderEpochs
        link
        fedilink
        9•6 months ago

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

        Well yeah just delete the pointer to it!

        • @PoolloverNathan@programming.dev
          link
          fedilink
          2•6 months ago

          universe.take()

    • @vithigar@lemmy.ca
      link
      fedilink
      16•6 months ago

      Except you missed a bug in the “check if it’s sorted” code and it ends up destroying every universe.

      • @db2@lemmy.world
        link
        fedilink
        7•6 months ago

        There’s a bug in it now, that’s why we’re still here.

Programmer Humor@programming.dev

!programmer_humor@programming.dev
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
  • 26 users / day
  • 439 users / week
  • 1.16K users / month
  • 3.83K users / 6 months
  • 3 subscribers
  • 1.15K Posts
  • 32.1K Comments
  • Modlog
  • mods:
  • Feyter
  • adr1an
  • @BurningTurtle@programming.dev
  • Pierre-Yves Lapersonne
  • BE: 0.18.5
  • Modlog
  • Legal
  • Instances
  • Docs
  • Code
  • join-lemmy.org