@pglpm So now I'm interested to know if that's right or not 😂
I learnt this algorithm as a way of picking a random line from a large file, with an equal chance of picking any line, only storing one line at any one time and passing through the file only once: store the first line, then reading line by line replace the stored line with line n with probability 1/n.
=> More informations about this toot | View the thread | More toots from petrichor@digipres.club
text/gemini
This content has been proxied by September (3851b).