Home > Software engineering > Two-dimensional coordinate scheduling problems, and don't know anyone before, can you give me a
Two-dimensional coordinate scheduling problems, and don't know anyone before, can you give me a
Time:10-02
Concrete is this: there is a array arr (I, 1), the arr (I, 0) on behalf of the X coordinates, arr (I, 1) on behalf of the Y coordinate, these points are rows, such as a row of 10 points, the second row of four points, the third row 6 so rows, one row of point's Y coordinate were similar, but not completely equal,
Question: we used is from left to right, from the top down, do the point of a sort, as we count the number of points, after a row number, and then the next row,
If the great spirit saw, don't spray,,,
Ordinary sort code to search on the net, but this I really have no idea, the problem is that each row number and row number is not sure, A great god, please give a train of thought, if you have the source code will be better ~ ~ ~ ~
CodePudding user response:
You an example to explain how to order...
CodePudding user response:
Whatever you use what sort algorithm, Need to change is to compare the size of original & gt; , & lt; In comparison with a custom function realization, Implement your own rules within the function: Row such as o=Int (Y) \ 10, divide the Y coordinates into highly 10 rows, To compare the first row size, on the same row and then compare the size of the X,