/ Published in: JavaScript
Expand |
Embed | Plain Text
var Sort = { bubble : function(a) { var i, j, t, n = a.length; for (i = 0; i < n; i++) { for (j = n - 1; j > i; j--) { if (a[j - 1] > a[j]) { t = a[j - 1]; a[j - 1] = a[j]; a[j] = t; } } } return a; } };
You need to login to post a comment.
