标签:blog http io ar java for strong sp 数据
高级排序算法:(处理大数据:百万以上)
首先在类中添加间隔数组: this.gaps = [5,3,1]; 然后添加函数: function shellsort() { for(var g = 0; g < this.gaps.length; ++g) { for(var i = this.gaps[g]; i < this.dataStore.length; ++i) { var temp = this.dataStore[i]; for(var j = i; j >= this.gaps[g] && this.dataStore[j - this.gaps[g]] > temp; j -= this.gaps[g]) { this.dataStore[j] = this.dataStore[j - this.gaps[g]]; } this.dataStore[j] = temp; } } }
标签:blog http io ar java for strong sp 数据
原文地址:http://www.cnblogs.com/jinkspeng/p/4036438.html