Beehaw
  • Communities
  • Create Post
  • search
    Search
  • Login
  • Sign Up
The Picard Maneuver ( The_Picard_Maneuver@startrek.website )  to Programmer Humor@programming.dev · 3 years ago

Programmer tries to explain binary search to the police

startrek.website

message-square
59
link
fedilink
1.37K

Programmer tries to explain binary search to the police

startrek.website

The Picard Maneuver ( The_Picard_Maneuver@startrek.website )  to Programmer Humor@programming.dev · 3 years ago
message-square
59
link
fedilink
  • potterman28wxcv ( potterman28wxcv@beehaw.org ) 
    link
    fedilink
    arrow-up
    1
    ·
    3 years ago

    I do not get why it would work in that case. I assume the scenario is someone with a bike coming, doing theft, then leaving with the same bike.

    Therefore there will be a period without bike, then a period with bike, then a period without bike again.

    Let’s assume there is no bike on the particular moment viewed. How do you know whether it occured before or after the theft? If you make the wrong decision, you get stuck on an endless binary search… Unless you take note at each timestamp where you made the decision, draw a tree of timestamps, and go back the tree if your search is fruitless but that’s much more complicated than what this post says.

    • Aatube ( Aatube@kbin.social ) 
      link
      fedilink
      arrow-up
      11
      ·
      3 years ago

      To me it sounds like they stole the bike.

      • potterman28wxcv ( potterman28wxcv@beehaw.org ) 
        link
        fedilink
        arrow-up
        1
        ·
        3 years ago

        Thanks indeed I misunderstood the problem

    • ѕєχυαℓ ρσℓутσρє ( SexualPolytope@lemmy.sdf.org ) 
      link
      fedilink
      arrow-up
      10
      ·
      3 years ago

      You’re making this way more complicated than it actually is. The guy definitely can give estimates for when he parked the bike and when he found out that it was stolen. It’s not that complicated.

      • potterman28wxcv ( potterman28wxcv@beehaw.org ) 
        link
        fedilink
        arrow-up
        1
        ·
        3 years ago

        I misunderstood the problem. I thought the thieve came on bike to steal something. I did not get that the bike itself was what got stolen.

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
    • If the mod doesn’t find it funny, you’re banned. Ha-ha!.. For real: do not use the community for “statements”. There are other places for such content. Keep it chill and funny.
Visibility: Public
globe

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

  • 533 users / day
  • 2.92K users / week
  • 4.07K users / month
  • 7.69K users / 6 months
  • 463 local subscribers
  • 33.7K subscribers
  • 1.56K Posts
  • 25.6K Comments
  • Modlog
  • mods:
  • Feyter ( Feyter@programming.dev ) 
  • adr1an ( anzo@programming.dev ) 
  • BurningTurtle ( BurningTurtle@programming.dev ) 
  • Pierre-Yves Lapersonne ( pylapp@programming.dev ) 
  • BE: 0.19.15
  • Modlog
  • Legal
  • Instances
  • Docs
  • Code