Search:

Type: Posts; User: brewbuck

Search: Search took 0.05 seconds.

  1. Then you must have a bug in your sorting...

    Then you must have a bug in your sorting algorithm. Look more carefully at my comparison function.

    For two elements with unequal z, the one with lower z will come first.

    For two elements with...
  2. You said you wanted to sort by z. Then, within...

    You said you wanted to sort by z. Then, within each group of z, you wanted to sort by time. That's what this comparison function accomplishes. Unless I misunderstand what you are trying to do, this...
  3. You want to sort by (z, time). In other words: ...

    You want to sort by (z, time). In other words:



    int compare( int z1, int time1, int z2, int time2 )
    {
    if( z1 < z2 ) return -1;
    if( z1 > z2 ) return 1;
    if( time1 < time2 ) return...
Results 1 to 3 of 3