lemmy.mixdown.ca
  • Communities
  • Create Post
  • heart
    Support Lemmy
  • search
    Search
  • Login
  • Sign Up
cm0002@lemmy.world to Programmer Humor@programming.dev · 6 months ago

timeoutSort

lemmy.ml

message-square
5
link
fedilink
4

timeoutSort

lemmy.ml

cm0002@lemmy.world to Programmer Humor@programming.dev · 6 months ago
message-square
5
link
fedilink
alert-triangle
You must log in or register to comment.
  • Eager Eagle@lemmy.world
    link
    fedilink
    English
    arrow-up
    1
    ·
    6 months ago

    finally, sorting in linear time /s

  • Kairos@lemmy.today
    link
    fedilink
    arrow-up
    1
    ·
    6 months ago

    Race condition

  • mcmodknower@programming.dev
    link
    fedilink
    English
    arrow-up
    1
    ·
    6 months ago

    I know this under the name sleepSort.

  • JargonWagon@lemmy.world
    link
    fedilink
    arrow-up
    0
    ·
    6 months ago

    I’m dumb, can someone ELI5 please?

    • scrion@lemmy.world
      link
      fedilink
      arrow-up
      1
      ·
      6 months ago

      The output is sorted due to the fact that for each number, a timer is started that prints out the number after waiting a number of milliseconds equal to said number.

      Therefore, 1 is printed first after delaying for 1 millisecond, 5 is printed second after 5 milliseconds etc.

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.

  • 1.47K users / day
  • 4.51K users / week
  • 8.86K users / month
  • 16.5K users / 6 months
  • 1 local subscriber
  • 31K subscribers
  • 2.09K Posts
  • 58.2K Comments
  • Modlog
  • mods:
  • Feyter@programming.dev
  • adr1an@programming.dev
  • BurningTurtle@programming.dev
  • Pierre-Yves Lapersonne@programming.dev
  • BE: 0.19.11
  • Modlog
  • Instances
  • Docs
  • Code
  • join-lemmy.org