Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Need custom sorting algorithm
#14
(11-14-2023, 01:34 PM)RhoSigma Wrote:
(11-14-2023, 10:35 AM)SMcNeill Wrote:
(11-14-2023, 09:54 AM)bplus Wrote: This is crazy to order the columns most simialr to all the other columns???
You can only compare all the other columns to one of the columns for a proper compare of matches.

Otherwise a column thats all *'s will match perfectly any other column with random *'s if that's what you really want then order the columns by most *'s

Not really, I don't think.   Take a look at this example:

x----
x----
x----
x----
-xxxx

Now the first column has 4 stars, but it doesn't match any of the other columns.
The other columns only have 1 star, but they all match in the same row.

I'm thinking that it might be the 4 columns that we're looking for here, rather than the 1 column with all the stars?

I not really followed this, but it seems like a normal binary number sort to me, instead of *--**-**, think of it as 10011011. That's a number and can be perfectly sorted with other numbers (similar bit patterns).

I don't think it's quite that simple either, Rho.   Think of this set of data:

x----
x----
x----
x----
-xxxx
---xx

Now, if you just look at going down, column 1 has the most matches.
If you just look going right, row 4 has the most matches.

I think what he's looking for here is columns 4 and 5, which each have 2 stars matching between them.

The only way I see to get this is basically just as bplus said:  "You can only compare all the other columns to one of the columns for a proper compare of matches."

The trick is you just have to do a loop to compare ALL of those columns 1 by 1, against all of the other columns, and then shuffle the results of those matches.
Reply


Messages In This Thread
Need custom sorting algorithm - by random1 - 11-12-2023, 05:07 AM
RE: Need custom sorting algorithm - by SMcNeill - 11-12-2023, 06:33 AM
RE: Need custom sorting algorithm - by random1 - 11-13-2023, 11:04 AM
RE: Need custom sorting algorithm - by SMcNeill - 11-12-2023, 06:43 AM
RE: Need custom sorting algorithm - by random1 - 11-13-2023, 12:59 PM
RE: Need custom sorting algorithm - by SMcNeill - 11-12-2023, 06:05 PM
RE: Need custom sorting algorithm - by RhoSigma - 11-12-2023, 06:11 PM
RE: Need custom sorting algorithm - by random1 - 11-14-2023, 08:59 AM
RE: Need custom sorting algorithm - by bplus - 11-14-2023, 09:54 AM
RE: Need custom sorting algorithm - by SMcNeill - 11-14-2023, 10:35 AM
RE: Need custom sorting algorithm - by RhoSigma - 11-14-2023, 01:34 PM
RE: Need custom sorting algorithm - by SMcNeill - 11-14-2023, 04:35 PM
RE: Need custom sorting algorithm - by bplus - 11-14-2023, 06:07 PM
RE: Need custom sorting algorithm - by bplus - 11-15-2023, 02:51 AM



Users browsing this thread: 1 Guest(s)