摘要: script Array.prototype.swap = function(i, j) { var temp = this[i]; this[i] = this[j]; this[j] = temp; } Array.prototype.bubbleSort = function() { for (var i = this.length - 1; i 0; --i) { for (var j = 0; j i; ++j) { if (this[j] this[j + 1]) this.swap(j, j + 1); } } } Array.prototype.selectio 阅读全文
posted @ 2010-12-27 20:25 wupingzsf 阅读(405) 评论(0) 推荐(0) 编辑