void bubblesort(int arr[], int length)
{
// Bubble largest number toward the right
for (int i = length-1; i > 0; i--)//can you explain this logic to me??
for (int j = 0; j < i; j++)//can you explain this to me??
if (arr[j] > arr[j+1])//can you explain this to me???
{
// Swap the numbers
int temp = arr[j+1];
arr[j+1] = arr[j];
arr[j] = temp;
}
}
//can you pls explain the logic to me thank you!