number one new yournk hater


prophetgoddess
@prophetgoddess

it used to be so fucking easy to get your name immortalized in computer science dude. dijkstra's algorithm and the fisher-yates shuffle are literally just the first thing i would try


prophetgoddess
@prophetgoddess

ME: i need to write a shuffler i know there's an algorithm for it i wonder if it does anything special

FISHER AND/OR YATES: have you tried randomly swapping items in the array

ME:


prophetgoddess
@prophetgoddess

ME: i need to find the shortest path between these nodes on this graph, i wonder what insight edsger dijkstra has to offer

EDSGER DIJKSTRA: have you considered checking the closest nodes first

ME:


cr1901
@cr1901

I invented linked lists independently of anyone else before I even knew what they were!


noa
@noa

mark and sweep garbage collection is literally just mark everything that's reachable and delete anything else.

maybe no one had considered doing garbage collection before, but as soon as you do that is the most basic possible algorithm


toad
@toad

worry ye not! computer science will not be immortal


You must log in to comment.

in reply to @prophetgoddess's post:

I did, genuinely, invent Dijkstra’s algorithm from first principles when I was about 16. I was doing a problem for a programming competition and came up with what I thought was a clever solution. A few years later in university I learned about Dijkstra’s algorithm and immediately recognized it as a more formalized and refined way of thinking about the exact thing I had built.

Fisher-Yates I did not invent; I had written some bad shuffling algorithms that I never quite trusted but it turns out it’s hard to prove/disprove that a shuffle algorithm gives a uniform distribution when you’ve had no formal training. And there are a few ways to get Fisher-Yates slightly wrong and mess it up.

to be fair it's slightly more complicated than randomly swapping items in the array. you can't just go to a random index and swap the value with another random index. you have to make sure that every element gets randomized. which is pretty simple