Home > Back-end >  The C language
The C language

Time:09-15

Rearrange the sequence, make with odd array on the left, the right to an even number

CodePudding user response:

Bubble sort just judgment conditions change,

CodePudding user response:

With bubble it is too bad to do
Yao is a simple O (n)
Why do you want to write O (n * n)

CodePudding user response:

Method 1: insertion sort judgment conditions change don't judge the size of the figure number is on the left is on the left and on the odd number is an even number on the right is inserted into the
Method 2: create a new array to put all the odd number of new array, then all the even Numbers in a new array

Way too much you with which looked at which to use
  • Related