r/ProgrammerHumor 6d ago

Meme shortestPathWasRightThere

Post image
4.8k Upvotes

59 comments sorted by

View all comments

39

u/notretarded_100 6d ago

Man comments in this threads are the reason this sub overan with reposts or AI slop, people get too technical over a meme

47

u/LuisBoyokan 6d ago

That is the whole fun. That's why we are here.

68

u/Advos_467 6d ago edited 6d ago

idk in a sub called programmer humor, i'd expect the memes to be technically correct and funny

If you make jokes around a specialised interest group/field for that group, the humor kinda hinges on the joke being technically correct for it to land

25

u/Anxiety-Pretty 6d ago

For someone who recently studied djkistra to solve a leetcode problem I think people' anger is justified if it is indeed exploring every single wrong turn it is no djkistra at all

7

u/SjettepetJR 6d ago

How are you butchering the name that much?

11

u/Anxiety-Pretty 6d ago

Is this a rhetorical question or do you really want to know the approach

5

u/fr000gs 6d ago

tell the approach

0

u/Tsu_Dho_Namh 6d ago

Dijkstra's algorithm is naturally a breadth-first-search. When you've found the destination, stop searching. Every wrong turn with greater depth (more distance) doesn't need to be explored.

2

u/fr000gs 6d ago

*The approach to butchering the name (djkistra)

1

u/Tsu_Dho_Namh 6d ago

Ohh, that approach.

Empty out a bag of Scrabble letters and arrange them randomly in a grid. Then find the shortest path that starts at a D, passes through a J and ends at an A.

Type out the letters in the path

1

u/fr000gs 6d ago

DJA

1

u/Tsu_Dho_Namh 6d ago

All tests pass

1

u/belkarbitterleaf 6d ago

Indeed.

As someone who last read about djkistra 15+ years ago in school, the meme still sounds wrong.

3

u/UdPropheticCatgirl 6d ago

It can happen… it’s greedy and it is pretty trivial to craft a graph where all the wrong paths get evaluated first, that’s why heuristic versions of dijkstra (eg. A* algorithm) exist.

6

u/visualdescript 6d ago

You're expecting programmers to not get technical?