Write a sorting algorithm for a list of integers that has an average performance of O(n^2).
This is code-golf, so the shortest code in bytes wins.
RULES:
The characters wasted for the declaration of the list are not counted
(e.g.
var c = new List<int>() { 4, 2, 1, 3 };is not counted)Builtins to sort a list are not allowed.
The best I did in C# is 82 ('c' is the list to be sorted):
var n=c.ToList();for(int i=0;i<n.Count;i++){int x=c.Min();c.Remove(x);n[i]=x;}c=n;
p≤₁in Brachylog is probably not in the spirit of that rule, but it complies with the letter. \$\endgroup\$