KOMPARASI ALGORITMA SORTING

BUBBLE Sort

function Bubble()
{
c_delay=0;


for(var i=0;i {
for(var j=0;j {
div_update(divs[j],div_sizes[j]);

if(div_sizes[j]>div_sizes[j+1])
{
div_update(divs[j],div_sizes[j]);
div_update(divs[j+1],div_sizes[j+1]);

var temp=div_sizes[j];
div_sizes[j]=div_sizes[j+1];
div_sizes[j+1]=temp;

div_update(divs[j],div_sizes[j]);
div_update(divs[j+1],div_sizes[j+1]);
}
div_update(divs[j],div_sizes[j]);
}
div_update(divs[j],div_sizes[j]);
}
div_update(divs[0],div_sizes[0]);

enable_buttons();
}