3
I know of various forms of ordination such as Selection Sort, Bubble Sort and Quicksort, we also have PHP functions like sort()
and array_multisort()
.
Currently the system I developed works with Bubble Sort because it is the simplest, but from what I saw it is more time consuming, and now working on updating the system implemented the use of array_multisort()
, but it came to me the doubt of how this function works and if it would not be better I create a Quicksort, currently my system works with little data so is indifferent the method chosen but thinking about the future and its maintenance which would be the best choice?
What am I ordering? It’s a array that has the distances of a point X to N points and now using the array_multisort()
after ordering by distance I order by time.
But the intention is to know which point is closest to
X
? This is information that changes or is "fixed" ?– Isac
@Isac the problem of the question is not the ordering that I am quietly doing my doubt is as to what would be the best way to do for improved maintenance and performance
– Vinicius Shiguemori
I ask the question why to know the
N
closest points ofX
or points toY
radius of distance ofX
does not imply ordering, and will be more efficient without ordering.– Isac
@Isac I work with the information already calculated by the Google API, which returns me a json with the data and then I create some arrays 2 of them one being distance and the other time, and so I order them from smaller to larger
– Vinicius Shiguemori