Home > Back-end >  How to solve on the basis of the distance from the origin from small to large to the coordinates of
How to solve on the basis of the distance from the origin from small to large to the coordinates of

Time:11-28

The content in the complete sortArrayPoints

CodePudding user response:

Sequencing is a simple, direct, bubbling,
But the problem is that once the order is successful, you have a problem, your program logic

CodePudding user response:

reference 1st floor ctrigger response:
sort is very simple, bubble can directly,
But the problem is that once the order is successful, you have a problem, your program logic

Why logic will be a problem

CodePudding user response:

refer to the second floor meat totoro response:
Quote: refer to 1st floor ctrigger response:
sort is very simple, bubble can directly,
But the problem is that once the order is successful, you have a problem, your program logic

Why logic will be a problem?


You logic is the ith point, corresponding to the array D [I] value, given array D sort, former D [I] value location may change,
Your program logic is wrong? What a mess??
  • Related