Share your repls and programming experiences

← Back to all posts
Dijkstra's algorithm one liner! (1 line series)[no6]
h
rafrafraf

the one line master is back ;)

This time i made dijkstra's algorithm in one line, it took me around 2 hours to make and uhm yeah it was hard lmao

As usual, no semi colons, true one liner.

Voters
alishascoder
Kgbadz
BananaJellyfish
JBloves27
IntellectualGuy
MatthieuBASTO
LegendaryWolf
ch1ck3n
MarcusWeinberger
CookieSnowOwl
Comments
hotnewtop
CookieSnowOwl

upvoted wow amazing
2. it's so funny when u enter g the error message is SOOO LONG

Th3Coder

WOAH! HOW DID YOU DO THAT???

I am simply astonished by this.

Also, no semicolons? That's new, but really cool!

Also, if I may ask, what is unvisited? Thanks!

MarcusWeinberger

@Th3Coder that contains all the nodes yet to be visited

Th3Coder

@MarcusWeinberger so does that mean all nodes that haven't been accessed yet?

Anyways, thanks!

MarcusWeinberger

@Th3Coder yep, dijkstra's algorithm works by checking the distance to all unvisited nodes. and no problem!

BananaJellyfish

Wow, one line! This is really cool!

MarcusWeinberger

Bruh you gotta print the route as well come on

MarcusWeinberger

Damnnn it took me longer than that just to make it normally

ch1ck3n

7 7 7 7 7 7 7 7 7 7 7 7 7 how