Update bubble-sort.cpp
parent
cd7e1af3fe
commit
c36bc74fde
|
@ -18,7 +18,7 @@ int main()
|
||||||
{
|
{
|
||||||
swap = false;
|
swap = false;
|
||||||
for (int j= 0; j< n-1; j++)
|
for (int j= 0; j< n-1; j++)
|
||||||
{ //comparing adjecent elements of array
|
{ //comparing adjacent elements of array
|
||||||
if (arr[j]>arr[j+1])
|
if (arr[j]>arr[j+1])
|
||||||
{ // swapping array elements
|
{ // swapping array elements
|
||||||
temp = arr[j];
|
temp = arr[j];
|
||||||
|
|
Loading…
Reference in New Issue