Computer Chess Club Archives


Search

Terms

Messages

Subject: Re: [OT] pseudo-code for O(n log(n)) solution

Author: Simon Finn

Date: 02:47:28 06/26/00

Go up one level in this thread


>static int compare(solution* a, solution* b)
>{
>    int i;
>    for (i = 0; i < SOLUTION_SIZE; i++)
>    {
>        if (a[i] < b[i]) return -1;
>        if (a[i] > b[i]) return 1;

Sorry - that should be:
         if ((*a)[i] < (*b)[i]) return -1;

etc.

>    }
>    return 0;
>}
>

Simon




This page took 0 seconds to execute

Last modified: Thu, 15 Apr 21 08:11:13 -0700

Current Computer Chess Club Forums at Talkchess. This site by Sean Mintz.