Skip to content

Commit aa71354

Browse files
committed
Minor update in Bubble sort code
1 parent 9f67819 commit aa71354

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

Sorting/Bubble Sort/bubble-sort.js

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,8 @@ function modifiedBubbleSort(arr){
4444
}
4545

4646

47-
/** Testing Bubble sort algorithm **/
47+
/******************* Testing Bubble sort algorithm *********************/
48+
4849
/**
4950
* Returns a random integer between min (inclusive) and max (inclusive)
5051
* Using Math.round() will give you a non-uniform distribution!
@@ -55,9 +56,10 @@ function getRandomInt(min, max) {
5556

5657
var arr = [];
5758

58-
for(var i=0;i<10;i++){
59+
for(var i=0;i<10;i++){//initialize a random integer unsorted array
5960
arr.push(getRandomInt(1, 100));
6061
}
62+
6163
console.log("Unsorted array: ");
6264
console.log(arr); //printing unsorted array
6365

0 commit comments

Comments
 (0)