├── README.md ├── jss.js └── 11.js /README.md: -------------------------------------------------------------------------------- 1 | # alex-2 -------------------------------------------------------------------------------- /jss.js: -------------------------------------------------------------------------------- 1 | let array = []; 2 | -------------------------------------------------------------------------------- /11.js: -------------------------------------------------------------------------------- 1 | var arr = [5,6,3,1,2,4]; 2 | 3 | bubbleSortAlgo(arr); 4 | 5 | function bubbleSortAlgo(arr){ 6 | for(var i=0;iarr[j+1]){ 9 | var tempValue= arr[j]; 10 | arr[j]=arr[j+1]; 11 | arr[j+1]=tempValue; 12 | } 13 | } 14 | } 15 | console.log("array is sorted using bubble sort algorithm and the sorted array is "); 16 | console.log(arr); 17 | } --------------------------------------------------------------------------------