Re: Multiple Arrays Sorting

From: Kurt Barthelmess (kbarthelmess_at_compuserve.com)
Date: 12/09/03


Date: Tue, 09 Dec 2003 17:21:16 GMT


"Jacques Oberto" <jo@N.O.S.P.A.M> wrote:

>For each array, the A, B..Z values are independent.
>Basically I need to compare each array on the A values then
>on the B values etc .. up to Z and then ordering the
>array position in the list in such a way that two neighbouring
>arrays will be the closest ones based on all their repective
>values.

ok, so your sort the items using whatever algorithm you like. Only the
comparison function compares the two A values first. If one is less or
greater then the other, you know which array comes first. If they're
equal, look at the two B values and do the same thing, going on to C,
D, etc.

Does that help?

Kurt



Relevant Pages

  • Re: PHP - I give up.
    ... /* Compares A and B, given auxiliary data AUX, and returns a ... typedef int algo_predicate_func (const void *data, ... SIZE bytes each, using COMPARE for comparisons. ... first element in ARRAY that matches TARGET, ...
    (comp.programming)
  • Re: working with byte arrays
    ... array before the values are assigned. ... Before I allways thought that ALL bytearray operations require a redim, ... >> If you know a better way to compare two byte arrays then please let me ... > Public Sub ShareMemoryViaArray(ByVal ArrayPtr As Long, ...
    (microsoft.public.vb.general.discussion)
  • Re: An inefficiency in Array.Sort
    ... use a temporary array, and Array.Sort is an in-place sort. ... they repeatedly compare ato a. ... former really makes no sense at all, especially presuming a QuickSort ... It is possible that the sort algorithm loses track of the original array ...
    (microsoft.public.dotnet.languages.vb)
  • Re: Array comparison
    ... pointers are only going to compare their object pointers ... pointers and not the contents of the strings. ... things like array of Char, bytes, words, dword, int64's etc.. ...
    (alt.comp.lang.borland-delphi)
  • Re: [PHP] Selecting Rows Based on Row Values Being in Array
    ... Please excuse the ignorance, I'm a newbie, but I'm only use to simple ... I'm asking because I don't know where we're telling the code to compare the ... Selecting Rows Based on Row Values Being in Array ... create one string from them, then it will compare each string in the ...
    (php.general)