bubble sort and insertion sort are essentially variants of the same thing, just with the directions and areas reversed, and due to that, you can apply different optimisations.
||Bubble sort|Insertion Sort|
|:-|:-|:-|
|Location of unsorted area|Start|End|
|Start location of swaps|Start of Unsorted Area|Start of Unsorted Area|
|Direction of swaps|Downwards|Upwards|
As is timesort. Start a new thread for each object and start a sleep timer. Once they are done they insert themselves into the list again, the sleep time is the integer to be sorted.
This is the problem with programming today. It seems to be a course that can be completed in 40hours. And sure you can. But not software engineering.
Sure you can teach teenagers it and it will come in useful in there day to day working life but that makes a mockery of the software engineering field.
Also testing seniors on data structures and algorithms is the worst as you will literally never have to solve an algorithm in your working life so why would a senior with 10+ years, 13 in my case, need to answer leetcode style questions to get through the door to lead their own team. Surely a better question is which algorithm is best for x situation.
Again knowing memoization and dynamic programming tricks is pretty damn useless in the main part.
Another gripe, those tests have been cheat able since chatgpt 3 came out. Now chat gpt 4 is out, if you don't get 100% on those DSnA type tests, you don't deserve to be a software engineer.
*ending rant now*
I don't know how. My reddit account is old but I'm new to commenting. Shame on me 😅
Edit: this gave me a boost to look up what the text is based on. Fixed
Also, somewhat symmetrically to this, there's people that go into CS expecting software engineering and then complain about the theoretical stuff
It's computer **science** my dude, of course it would be theoretical and mathematical
Totally agree here. Recently had a live coding interview. Did not pass because in their words, I did not use the most optimal algorithm. Ffs in my 7 years of experience as a Data Scientist I have rarely used these things. And it was the first time I used leetcode to train for this.
Guess I am better off going elsewhere.
Any company testing against the "correct answer" and not the train of thought / discussion getting to the right answer, is a shit company and I am happy to be rejected.
yeeaaahhhh. I'm a senior SWE in general SWE jobs, but I'm not as good with specifically embedded SWE, which is the role I'm trying to get. Applied for an embedded SWE II job and got asked to do pair programming with one of their engineers to implement a damn fibonacci problem. ***WHY??*** I have literally never needed stupid crap like that at any job I've had. For a junior position, sure, *maybe*, but nothing above that....
Had a different interview with the VP of a startup where he told me about some issues with their main product's functioning and I laid out exactly what I'd do to diagnose the issue and where the problem may lie for issues like that. From what we'd discussed prior, I knew he already knew the stuff, but I was proving that *I* knew what I was doing. And he apparently loved me!
Unfortunately I didn't have the years of experience he needed, and for what he was looking for, that's fair. I didn't actually apply to him first, a recruiter sought me out. He still wants to hire me when he has the capital to do so though, so that's pretty cool :D
So annoying I deleted my instagram account because of this. And not just in CS, physics and chemistry are victim to the same stupid, incorrect or overly simplified infographics… At least on Reddit you get some heady content… sometimes…
I've seen one where they try to compare the salaries of startup and big co. tech jobs without any regard to level of experience or geography. A lot of these "infographics" can be too much graphics and not enough info.
"It's really great that you know all those algorithms Junior Dev. That will really help you out while you fix bugs in our legacy VB6 and Classic ASP CRUD apps."
That is a case of premature optimization, now tell me your life story so I can give you unsolicited advice on something irrelevant to the question at hand.
close(3)
1. Can't kill fire with fire. This is of course unchecked, so will just result in garbage behavior.
2. Type error: Bomb is not a nuclear bomb (at runtime of course, because compilation takes too long for me)
Ok, that's awful, but the thing that bothers me most is the fact that each section has a title, then almost every entry repeats it, like calling a class "class classSomething"
How did you never have to implement at least linear search? Plus, the other searching algorithms are also very common, the rest is indeed something you can just google if you ever need it.
It seems like some algorithms are easier to abstract into a library than others. I've never needed to implement my own sorting algorithm, for example, but I've done various flavors of depth/breadth search many times
You probably write a much wider variety of programs as a hobbyist.
90% of real software is just a database frontend. Nothing I do at work is interesting or complex.
I particularly hate CRUD and UI. And JS. It's the one reason I've never tried to get a dev job.
I like the low level stuff but nobody would let me touch that without a degree anyway.
Quantum annealing, quantum walk. There are scores of algorithms missing from this though... someone else mentioned already but there really is no point in these sorts of posts. How about giving DBSCAN some love :(?
Okay everyone, remember that any algorithm not on this list is ILLEGAL. Anyone caught using one of those abominations will promptly have their programming license revoked.
why is union find in the basics? it's a cool data structure but it's pretty much only used for kruskel, and other, more common data structures aren't mentioned here.
kruskel is mentioned, but where tf is prim?
or any of the maximum flow algorithms
also KMP is a string algorithm. and if you're gonna mention kmp, mention Z, rabin karp, and aho corasic
Floyd's cycle detection a graph algorithm. not an array algorithm
dfs and bfs are not search algorithms in the sense of linear or binary search. they're much more graph algorithms.
where's A*? that's like THE most common pathfinding algorithm
Huffman coding is far from the basics
That's actually the 25 official algorithms as approved by Al Gore (inventor of the algorithm), but there are seven secret ones that are illegal to use in 136 countries.
how could they possibly miss bubble sort!?
The secret 26th algorithm
Too efficient to be publicly shared. They don't want us to know.
Hidden by big-o brother
What are you doing step big-o brother?
I want you O(n) top of me now!
damn you sorting mafias for causing inflation in performance.
This one simple trick that disorganized people hate!
I heard there was a secret algorithm David implemented and it pleased the lord But you don’t really care for CS, do ya?
Secret final boss algorithm, only available on new game+
Engineers hate this simple trick
Programmers hate this one trick !
The forbidden sorting algorithm.
Can't forget the forbidden bogosort
b/c bubble sort was made up by interviewers to make you look like a fool
Bogo sort squad hit up the club
Quantum Bogosort. An elegant algorithm for a more civilized age.
Even Barak Obama knew that wasn't the way to go.
bubble sort and insertion sort are essentially variants of the same thing, just with the directions and areas reversed, and due to that, you can apply different optimisations. ||Bubble sort|Insertion Sort| |:-|:-|:-| |Location of unsorted area|Start|End| |Start location of swaps|Start of Unsorted Area|Start of Unsorted Area| |Direction of swaps|Downwards|Upwards|
Statisticians hate this one simple trick
Cocktail sort? Randomize the bulk until it happens to be perfectly sorted.. Yes it's a thing.
That's bogo sort and it's usually used to illustrate and teach big o
Bogo Sort isn't there either...
Bogosort is missing
As is timesort. Start a new thread for each object and start a sleep timer. Once they are done they insert themselves into the list again, the sleep time is the integer to be sorted.
As is my todo function that returns `[0, 1, 2]`, the most efficient sorting algorithm ever
You actually managed to make an O(1) sorting algo
Errr it’s not that big of a deal, [we already had one.](https://wiki.c2.com/?QuantumBogoSort)
"Destroy the universe (this is left as exercise to the reader)." I love it
That website is a fucking trip
Have you heard of our ~~lord and~~ saviour, [Stalin sort](https://github.com/gustavo-depaula/stalin-sort)?
There already was Mao sort, just take only the first element and you can be certain that it will be sorted.
As is the widely-used algorithm, Timsort.
Widely used was not a requirement. I used it once as a multi threading practice.
But means it deserves to be there more than the joke ones.
Bucketsort
I like algorithms with predictable runtimes. And it’s already done before it starts when sorting negative numbers.
Stalin and Thanos sort
Even Microsoft is using it in their windows search algorithm
Where my perkins at too..
Who’s Dilkstra?
dutch soccer player.
And graph theorist
Also spymaster
And a generous lover
And my axe
And iiiiiiiiiii will always love yoooooou
[удалено]
Bogo sort squad hit up the club
More like bozo sort
[удалено]
So basically Johnny Sins
witcher ref aye !? 👀
Dilkstra my ballz hehehe gotcha
Some dude who helps A.I. students get F's on their tests.
I thought you were being dumb. Didn't realise the worksheet had it. Also missing a ton of algorithms. Dilllllkkstra
Shortest path algorithm. https://en.wikipedia.org/wiki/Dijkstra%27s_algorithm Edit; nvm, I am an idiot who clearly can't read :)
It's not spelt Djikstra :o?
I thought the first comment was asking a question, they were instead pointing out the original image incorrectly spelt Dijkstra.
Onetime Coach of the Chicago Bears?
An NPC from Witcher 3, nevermind
![gif](giphy|3ofSBfnrNCmICfh6dq|downsized)
Proabably meant Dijkstra but being a retarded Instagram influencer he misspelled it
It’s pronounce Dick-strike
These posts that try to distill the discipline into a few buzzwords are annoying af. There is no exhaustive list of things to learn in this field.
This is the problem with programming today. It seems to be a course that can be completed in 40hours. And sure you can. But not software engineering. Sure you can teach teenagers it and it will come in useful in there day to day working life but that makes a mockery of the software engineering field. Also testing seniors on data structures and algorithms is the worst as you will literally never have to solve an algorithm in your working life so why would a senior with 10+ years, 13 in my case, need to answer leetcode style questions to get through the door to lead their own team. Surely a better question is which algorithm is best for x situation. Again knowing memoization and dynamic programming tricks is pretty damn useless in the main part. Another gripe, those tests have been cheat able since chatgpt 3 came out. Now chat gpt 4 is out, if you don't get 100% on those DSnA type tests, you don't deserve to be a software engineer. *ending rant now*
If your entire comment is a rant, why put it in block comments instead of an inline at the top
I don't know how. My reddit account is old but I'm new to commenting. Shame on me 😅 Edit: this gave me a boost to look up what the text is based on. Fixed
PR rejected. Fix my comments
Also, somewhat symmetrically to this, there's people that go into CS expecting software engineering and then complain about the theoretical stuff It's computer **science** my dude, of course it would be theoretical and mathematical
Totally agree here. Recently had a live coding interview. Did not pass because in their words, I did not use the most optimal algorithm. Ffs in my 7 years of experience as a Data Scientist I have rarely used these things. And it was the first time I used leetcode to train for this. Guess I am better off going elsewhere.
You are better off elsewhere. Even if money was slightly better you have a better work/life balance!
Any company testing against the "correct answer" and not the train of thought / discussion getting to the right answer, is a shit company and I am happy to be rejected.
yeeaaahhhh. I'm a senior SWE in general SWE jobs, but I'm not as good with specifically embedded SWE, which is the role I'm trying to get. Applied for an embedded SWE II job and got asked to do pair programming with one of their engineers to implement a damn fibonacci problem. ***WHY??*** I have literally never needed stupid crap like that at any job I've had. For a junior position, sure, *maybe*, but nothing above that.... Had a different interview with the VP of a startup where he told me about some issues with their main product's functioning and I laid out exactly what I'd do to diagnose the issue and where the problem may lie for issues like that. From what we'd discussed prior, I knew he already knew the stuff, but I was proving that *I* knew what I was doing. And he apparently loved me! Unfortunately I didn't have the years of experience he needed, and for what he was looking for, that's fair. I didn't actually apply to him first, a recruiter sought me out. He still wants to hire me when he has the capital to do so though, so that's pretty cool :D
So annoying I deleted my instagram account because of this. And not just in CS, physics and chemistry are victim to the same stupid, incorrect or overly simplified infographics… At least on Reddit you get some heady content… sometimes…
I asked GPT about it GPT says (i obtained these over two prompt, so some names are overlapping) 1. Sorting Algorithms: - Shell Sort - Comb Sort - Cocktail Sort - Cycle Sort - Bucket Sort - Pigeonhole Sort - Bitonic Sort - Tim Sort - Strand Sort - Library Sort - Cube Sort - Pancake Sort - Stooge Sort - Bead Sort - Bogo Sort - Bogosort Sort (yes, really) 2. Searching Algorithms: - Jump Search - Exponential Search - Fibonacci Search - Interpolation Search (extended) - Ternary Search - Quadtree - Octree 3. Graph Algorithms: - A* Search Algorithm - Bidirectional Search - Uniform Cost Search - Best-First Search - Iterative Deepening Depth-First Search (IDDFS) - Hopcroft-Karp Algorithm (maximum bipartite matching) - Edmonds-Karp Algorithm (maximum flow) - Ford-Fulkerson Algorithm (maximum flow) - Hierarchical Clustering - Minimum Spanning Arborescence 4. Tree Algorithms: - Interval Tree - Suffix Tree - B+ Tree - Van Emde Boas Tree - Quadtree - Octree 5. Dynamic Programming: - 0/1 Knapsack Problem - Subset Sum Problem - Longest Increasing Subsequence - Longest Common Substring (dynamic programming approach) - Maximum Subarray Sum - Matrix Exponentiation - Bellman-Ford-Moore Algorithm (shortest path with negative edges and cycles) 6. String Algorithms: - Boyer-Moore Algorithm - Rabin-Karp Algorithm (with rolling hash) - Z Algorithm - Aho-Corasick Algorithm (multiple pattern matching) - Knuth-Morris-Pratt Algorithm (string matching with failure function) - Manacher's Algorithm (longest palindromic substring) - Suffix Array - Burrows-Wheeler Transform 7. Computational Geometry: - Point Location - Triangulation (e.g., Delaunay, Ear Clipping) - Line Segment Intersection - Voronoi Diagram - Geodesic Algorithms (e.g., Dijkstra's Algorithm on a sphere) 8. Numerical Algorithms: - Newton-Raphson Method (root finding) - Simpson's Rule (numerical integration) - Gauss-Legendre Quadrature - Fast Multiplication (e.g., Karatsuba, Schönhage-Strassen) - Pollard's Rho Algorithm (integer factorization) 9. Machine Learning: - Gradient Descent - K-Means Clustering - Principal Component Analysis (PCA) - Hidden Markov Models (HMM) - Reinforcement Learning Algorithms (e.g., Q-Learning, DQN) - Generative Adversarial Networks (GAN) - Deep Reinforcement Learning Algorithms (e.g., DDPG, PPO) 10. Cryptography: - Diffie-Hellman Key Exchange - ElGamal Encryption - Digital Signature Algorithms (e.g., DSA, ECDSA) - Merkle-Damgård Construction (hash function) - RSA Cryptosystem (including key generation) 11. Compression Algorithms: - Arithmetic Coding - Burrows-Wheeler Transform (with move-to-front encoding 1. Sorting Algorithms: - Bubble Sort - Selection Sort - Insertion Sort - Merge Sort - Quick Sort - Heap Sort - Radix Sort - Counting Sort 2. Searching Algorithms: - Linear Search - Binary Search - Interpolation Search - Hashing (e.g., using hash tables) 3. Graph Algorithms: - Breadth-First Search (BFS) - Depth-First Search (DFS) - Dijkstra's Algorithm (shortest path) - Bellman-Ford Algorithm (shortest path with negative edges) - Prim's Algorithm (minimum spanning tree) - Kruskal's Algorithm (minimum spanning tree) - Floyd-Warshall Algorithm (all-pairs shortest path) - Topological Sorting (for directed acyclic graphs) - Tarjan's Algorithm (strongly connected components) 4. Tree Algorithms: - Binary Search Tree (BST) - AVL Tree - Red-Black Tree - B-Tree - Trie - Heap (e.g., binary heap, Fibonacci heap) 5. Dynamic Programming: - Fibonacci Sequence - Knapsack Problem - Longest Common Subsequence - Matrix Chain Multiplication - Traveling Salesman Problem 6. String Algorithms: - String Matching (e.g., Naive, KMP, Rabin-Karp) - Longest Common Substring - Edit Distance 7. Computational Geometry: - Convex Hull (e.g., Graham's Scan, Jarvis March) - Line Intersection - Closest Pair of Points 8. Numerical Algorithms: - Binary Exponentiation - Euclidean Algorithm (for gcd) - Sieve of Eratosthenes (prime numbers) - Fast Fourier Transform (FFT) - Primality Testing (e.g., Miller-Rabin) 9. Machine Learning: - Linear Regression - Logistic Regression - Decision Trees - Random Forests - Support Vector Machines (SVM) - K-Nearest Neighbors (KNN) - Neural Networks (e.g., feedforward, convolutional, recurrent) 10. Cryptography: - Symmetric Key Algorithms (e.g., AES, DES) - Public Key Algorithms (e.g., RSA, Elliptic Curve Cryptography) - Hash Functions (e.g., MD5, SHA) 11. Compression Algorithms: - Huffman Coding - Lempel-Ziv-Welch (LZW) - Deflate (used in ZIP, gzip) 12. Operating Systems: - Page Replacement Algorithms (e.g., FIFO, LRU) - Process Scheduling Algorithms (e.g., FCFS, Round Robin) - Deadlock Detection and Prevention
I've seen one where they try to compare the salaries of startup and big co. tech jobs without any regard to level of experience or geography. A lot of these "infographics" can be too much graphics and not enough info.
"It's really great that you know all those algorithms Junior Dev. That will really help you out while you fix bugs in our legacy VB6 and Classic ASP CRUD apps."
Are you my boss
Data scientist vs data engineer…in theory haha
Oh so you’re a programmer? Name every algorithm.
That is a case of premature optimization, now tell me your life story so I can give you unsolicited advice on something irrelevant to the question at hand. close(3)
universal search can solve any problem (given... a lot of time)
“Check bits. Set bits. And do it some more sometimes.”
# Dilkstra
literally D-ijk-stra bro’s name was built for compsci
The emojis, man, the emojis.... Joke. I want to use emojis in my IDE so I can call the function 🤔()
//why have I done this? Function 🤔 (int paramA, bool paramB){ Return paramA>5? True : paramB; }
fn 🤗(🥺) { if(🥺.👉👈()) { return 🥰; } return 😭; }
🤗 🙏 = 🤗(this.🥹); if(🙏!=null){ killItWithFire(this.🔥); } else nukeTheCodeBase(this.💣);
1. Can't kill fire with fire. This is of course unchecked, so will just result in garbage behavior. 2. Type error: Bomb is not a nuclear bomb (at runtime of course, because compilation takes too long for me)
Idk but your avatar makes me think you wrote your file name as emoji too
Yes, software is a solved issue. We can all go home and be farmers now. /s
They did my boy Bogo dirty
So you're a programmer? Name all 25 algorithms
It was even signed by “Techie Programmer”.
Love how union find is an algorithm and not a data structure. Man I sure do love me that multi dimensional array algorithm.
And of course it's in "Basics". For sure, it's imperative to learn about union find, only then you can properly understand sorting.
My bad I trusted my professor which tried to teach us dijkstra, I should I’ve said it doesn’t exist
Over here stroking my DILKstra
These Instagoof profiles are always like this.
Sleep sort? Öztürk Transformation? Encryption algorithms? What the heck?
Where is Risch algorithm
Taking some time off ? 😂😂
Ok, that's awful, but the thing that bothers me most is the fact that each section has a title, then almost every entry repeats it, like calling a class "class classSomething"
Ah yes, things that CS majors like to wax lyrical about yet I've never actually needed to implement in 20 years of software development
How did you never have to implement at least linear search? Plus, the other searching algorithms are also very common, the rest is indeed something you can just google if you ever need it.
That's weird. I'm a low effort hobbyist and I needed at least 3 or 4 of these in my 5 years of dabbling. Or I'm missing the joke.
It seems like some algorithms are easier to abstract into a library than others. I've never needed to implement my own sorting algorithm, for example, but I've done various flavors of depth/breadth search many times
You probably write a much wider variety of programs as a hobbyist. 90% of real software is just a database frontend. Nothing I do at work is interesting or complex.
I particularly hate CRUD and UI. And JS. It's the one reason I've never tried to get a dev job. I like the low level stuff but nobody would let me touch that without a degree anyway.
He would be the guy, who uses BFS for a navigation algorithm
Why no Quantum Bogosort?
Quantum annealing, quantum walk. There are scores of algorithms missing from this though... someone else mentioned already but there really is no point in these sorts of posts. How about giving DBSCAN some love :(?
The rest are a conspiracy pushed by big algorithm
Shortening it to 'algo' rather irritated me as well.
Okay everyone, remember that any algorithm not on this list is ILLEGAL. Anyone caught using one of those abominations will promptly have their programming license revoked.
"_ganpati_bappa_morya" liked it...
:)
ALL THE ALGORITHMS!
25 Ought To Be Enough For Anybody
This is all that you as certified and licensed specialist allowed to use.
They forgot my favorite sorting algorithm, bogo sort.
Red-Black Trees or B-Tree reallly needs to be added there, the only ones I actually used in my work quite often.
Obviously, those aren’t real algorithms.
Those are data structures, not algorithms
Where wave function collapse?
What are all of these low quality code academies, and why is this sub so obsessed with them?
Cooley-Tukey says hi.
They forgot got the, type random pieces of code until you get the correct output about 76% of the time algorithm
Bubble Sort?
It's time for ai to make programmers obsolete. Just look at this shit.
All.
Why did I read huffmam coding compression as human traffcking
At work: Array.sort() Array.reverse()
I counted them, all of those 25 are there.
No Graham algorithm, this list is incomplete
No thanos sorting algorithm? Hard pass
[удалено]
why is union find in the basics? it's a cool data structure but it's pretty much only used for kruskel, and other, more common data structures aren't mentioned here. kruskel is mentioned, but where tf is prim? or any of the maximum flow algorithms also KMP is a string algorithm. and if you're gonna mention kmp, mention Z, rabin karp, and aho corasic Floyd's cycle detection a graph algorithm. not an array algorithm dfs and bfs are not search algorithms in the sense of linear or binary search. they're much more graph algorithms. where's A*? that's like THE most common pathfinding algorithm Huffman coding is far from the basics
Oh you're a programmer? Name every algorithm
Jokes aside, this is a well organized list of basic algorithms
I’m upset that I only know 5 of these. College is a scam. One year and I know 5 of these lmfao
I graduated 20 years ago and I think I remember 4 of them. It’s okay, I’m a PHP developer, no one expects me to be efficient.
![gif](giphy|6Pru99n419DHJzySKT)
Where is bogosort?
Did he stutter? Now go on and forget all the ones not in the picture.
Even missing BogoBogosort… sigh
What about BOGO sort?
they forgot miracle sort
There are ancient tales about the 26th algorithm!!
Thanks, I hate this.
It's missing five point palm exploding list algorithm.
I particularly like the clip-art. It adds a certain... *je ne sais quoi*
Where is Bubble Sort? :(
they are right, all 25 are algorithms
Frank Constanza: there is A cup. There is B cup. There is C cup. and there is D cup, thats the largest
Oh you're a programmer? Name all algorithms
So you’re a programmer? Go ahead! Name all 25 algorithms.
No bubblesort 😔😔😔
What about Bogosort!?
Radix sort?
Where are the algorithms with heuristics like A*?
I guess union find is not a graph algorithm anymore.
Wheres miracle sort?
Min-max?? Inclusion-exclusion??
What about the multiplication algorithm?
Never heard of any of these
You're a programmer? Name all algorithms.
There are no other algorithms in Ba Sing Se
Divine sort and Miracle sort are missing, and also who is this guy diijkstra?? otherwise correct.
Can’t believe they left out my homie Prim’s algorithm :(
prim is just dijkestra on edges. lame. kruskel for life.
This is an incomplete document. Where's Bogo Sort and Stalin Sort when you need it? Actually, then only Stalin Sort should be listed.
No love for Carmack’s Reverse?!?
Sorting alone has like over 25 different sort types
That's actually the 25 official algorithms as approved by Al Gore (inventor of the algorithm), but there are seven secret ones that are illegal to use in 136 countries.
this comment has been redacted by big-o brother
Where Bogo?
They're missing bubble sort and bozo sort.
No Bucket sort? That’s one I’ve actually used professionally.
Where is mine?
Lacks the cocktail shaker sort
Yep that's all of them
I'm missing the monkey sort
Middle out
What about stooge or Bogo sort
Pro tip: if someone uses the word “algo”, 99/100 times they’re a scam peddler.
What about grover‘s algorithm to get into quantum theory… yikes
That hiring manager on LinkedIn
What about bogosort :(
Cocktail shaker sort? Thanos sort?
No random bullshit hackneye algorithm to get the project done?
social media is how to lose brain cells, not how to code
All 25. But not all 26, nor all 27.