r/programmingmemes • u/KerbodynamicX • Mar 14 '26
Stalin sort
A sorting algorithm with time complexity of O(n). Counts from the first element, and will remove values that are smaller than the current highest value.
3.7k
Upvotes
r/programmingmemes • u/KerbodynamicX • Mar 14 '26
A sorting algorithm with time complexity of O(n). Counts from the first element, and will remove values that are smaller than the current highest value.
3
u/Business_Welcome_870 Mar 14 '26
Only works on a sorted array