Home > Back-end >  Why is my bubble sort does not work.
Why is my bubble sort does not work.

Time:03-14

CodePudding user response:

Select_sort function operation is a local variable in a array, not with x, so is a sort of local data sorting, no memory of x start sorting, x point to namely the main function of a array,

In addition, the bubbling bubble_sort proposal to change the function name;

Select_sort selection sort,
Changed to improve the readability of the code

CodePudding user response:

reference 1/f, confident boy reply:
select_sort function operation is a local variable in a array, not with x, so is a sort of local data sorting, no memory of x start sorting, x point to namely the main function of a array,

In addition, the bubbling bubble_sort proposal to change the function name;

Select_sort selection sort,
To improve the readability of the code ~

Then how to change it

CodePudding user response:

refer to the second floor qq_53643374 response:
Quote: reference 1/f, confident boy reply:
select_sort function operation is a local variable in a array, not with x, so is a sort of local data sorting, no memory of x start sorting, x point to namely the main function of a array,

In addition, the bubbling bubble_sort proposal to change the function name;

Select_sort selection sort,
To improve the readability of the code ~

Then how to change it


The select_sort function in a, replace with x.

In addition, get rid of the definition of a [20], use an array,
  • Related