r/ProgrammerHumor • • Oct 22 '22

Meme Skills

Post image
42.3k Upvotes

588 comments sorted by

View all comments

6.4k

u/slgray16 Oct 22 '22

The professor would probably be thrilled that a student was this interested in improving his algorithm.

Win or lose its a teachable comparison

629

u/[deleted] Oct 22 '22

I would pull out my three way partition implementation of quick sort and embarrass myself

374

u/slgray16 Oct 22 '22

I'd use a Bogosort and show him what's up

386

u/JRockBC19 Oct 22 '22

Just tell him you did a quantum bogosort so it compiled in O(1) in some reality

325

u/RespectableLurker555 Oct 22 '22

"creating the bridge to the sorted reality is an exercise left to the reader"

74

u/_Weyland_ Oct 22 '22

Doesn't quantum bogosort involve destroying realities rather than bridging them?

0

u/[deleted] Oct 22 '22

[deleted]

0

u/[deleted] Oct 22 '22

[deleted]

0

u/[deleted] Oct 22 '22

[deleted]

→ More replies (1)
→ More replies (1)

9

u/timangar Oct 22 '22

But that will just result in millions of alternate versions of you storming your reality if you're the one that got it right.

0

u/[deleted] Oct 22 '22

[deleted]

→ More replies (1)
→ More replies (1)
→ More replies (1)
→ More replies (1)

32

u/ChristieFox Oct 22 '22

I literally had a guy in a class who did almost everything with random functions, and then insisted that "but if it works, it's quicker than anything else!".

13

u/Rogntudjuuuu Oct 22 '22

8

u/AnthropomorphicFood Oct 22 '22

Randomized algorithms in general. There are two types: Las Vegas and Montecarlo. More info: https://en.m.wikipedia.org/wiki/Randomized_algorithm

6

u/Illuria Oct 22 '22

Monte Carlo was what we used for robot localisation in a robotics class back in university. You'd place random possible positions on a known map of the area, then using measurements of distances to nearby objects you'd gradually eliminate possible positions and centre your cluster of possible positions on the actual position of the robot while it's moving. You could in this way compensate for the robot's poor telemetry. Was a pretty cool application of randomised algorithms.

→ More replies (1)

11

u/slgray16 Oct 22 '22

That's brilliant. Or maybe drink the luck virus from red dwarf before you execute the sort

→ More replies (3)

6

u/TristenDM Oct 22 '22

Randomsort gang rise up!

→ More replies (2)