This is not the best sort, to say the least. But I do appreciate in this video how it demonstrates O(n^2) time complexity with just a single loop. Just because it's only one loop doesn't mean you're getting away with O(n)!

https://www.youtube.com/watch?v=9cIjvXEeOhQ

#programming #gnomesort #sorting #timecomplexity #bigo

Gnome sort, child of insertion and bubble sort in 3 minutes!

YouTube