+ 4
BucketSort
I have problems with the bucket sort, I mean I'm trying to make it with jagged arrays to put in it the buckets and then sorted. I been reading and many examples has been created with a list but... Someone has any idea to make it with arrays...or I have give up and try it with lists .. sorry by my English ! ,🙏
1 Antwort
+ 3
var jaggedarray = new int[3][];
jaggedarray[0] = new int[5] { 99, 999, 49, 79, 59 };
jaggedarray[1] = new int[3] { 199, 1999, 149 };
jaggedarray[2] = new int[2] { 999, 500 };
Array.Sort(jaggedarray, new Comparison<int[]>(
(x,y) => { return x[1] < y[1] ? -1 : (x[1] > y[1] ? 1 : 0); }
));