Sorting - are you sorting the array keys or the values ?

If you're sorting the keys, maybe it would be better to have another array
that holds a list of keys, sort that, and then use that as a "pointer" to
the actual array.

If you're sorting the values, then php has a good sort function (uses the
quick sort algorithm if I remember rightly)

-----Original Message-----
From: Morgan Grubb [mailto:[EMAIL PROTECTED]]
Sent: Monday, July 01, 2002 1:16 PM
Subject: Re: [PHP] Fast code to partially flatten an array based on
several keys?


I said I'd let you know how I got on.

It's all working, but only realistically for no more than 500 or so records.
When I feed it 10000+ records, the machine chokes.

So I'm back to textbooks just looking for clues on really fast sorting and
searching algorithms. I've written a mostly working quicksort routine, which
seems to have cut the time down significantly on searches, so I'll keep
plugging away at this.

Of course, now that it *appears* to be working, I'm getting a lot more work
dumped on me, so finishing it off is going to take a bit longer. =)

Morgan Grubb.


PHP General Mailing List (
To unsubscribe, visit:

Reply via email to