function myBubbleSort(arrayName, length) {
for (var i = 0; i < (length - 1); i++)
for (var j = i + 1; j < length; j++)
if (arrayName[j].CommentId < arrayName[i].CommentId) {
var dummy = arrayName[i];
arrayName[i] = arrayName[j];
arrayName[j] = dummy;
}
}
No comments:
Post a Comment