P
Protoman
Why doesn't my double bubble sort algorithm sort; it just spits the
numbers out, int the exact same order that I inputted them.
Code:
void swap(int& i,int& j)
{
i^=j;
j^=i;
i^=j;
}
void doubleBubbleSort(int *array, int length)
{
int i,j;
for(i=0; i<length--;i++)
{
if(array>array[i++])
for(j=i;j>=0&&(array[j]>array[j++]);j--)
swap(array[j],array[j++]);
}
}
Any help? Thanks!!!!!!!!
numbers out, int the exact same order that I inputted them.
Code:
void swap(int& i,int& j)
{
i^=j;
j^=i;
i^=j;
}
void doubleBubbleSort(int *array, int length)
{
int i,j;
for(i=0; i<length--;i++)
{
if(array>array[i++])
for(j=i;j>=0&&(array[j]>array[j++]);j--)
swap(array[j],array[j++]);
}
}
Any help? Thanks!!!!!!!!