not digg
  • Communities
  • Create Post
  • Create Community
  • heart
    Support Lemmy
  • search
    Search
  • Login
  • Sign Up
cm0002@lemmy.world to Programmer Humor@programming.dev · 3 months ago

timeoutSort

lemmy.ml

message-square
4
fedilink
  • cross-posted to:
  • programmerhumor@lemmy.ml
3

timeoutSort

lemmy.ml

cm0002@lemmy.world to Programmer Humor@programming.dev · 3 months ago
message-square
4
fedilink
  • cross-posted to:
  • programmerhumor@lemmy.ml
alert-triangle
You must log in or register to comment.
  • Kairos@lemmy.today
    link
    fedilink
    arrow-up
    1
    ·
    3 months ago

    Race condition

  • Eager Eagle@lemmy.world
    link
    fedilink
    English
    arrow-up
    1
    ·
    3 months ago

    finally, sorting in linear time /s

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

    I’m dumb, can someone ELI5 please?

    • scrion@lemmy.world
      link
      fedilink
      arrow-up
      1
      ·
      3 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.

  • 526 users / day
  • 3.11K users / week
  • 3.23K users / month
  • 14.9K users / 6 months
  • 1 local subscriber
  • 29.5K subscribers
  • 2.04K Posts
  • 31.1K Comments
  • Modlog
  • mods:
  • Feyter@programming.dev
  • adr1an@programming.dev
  • BurningTurtle@programming.dev
  • Pierre-Yves Lapersonne@programming.dev
  • BE: 0.19.5
  • Modlog
  • Instances
  • Docs
  • Code
  • join-lemmy.org