Ask a Question related to PHP Development, Design and Development.
-
Shaunak Kashyap #1
Sorting algorithm(s) used by PHP's sort function
Does anyone know what sorting algorithm(s) -- quicksort, mergesort,
radix sort, etc. -- does PHP use internally in its sort function?
Shaunak Kashyap Guest
-
Problem with SQL Statement/Sort Function
Hey everyone, I am inserting a drop down menu that will allow a user to sort the database result on my page. The problem is, i'm not sure where to... -
Ado sort error-Ado Sort -Relate, Compute By, or Sort operations cannot be done on column(s) whose key length is unknown or exceeds 10 KB.
Ado Sort -Relate, Compute By, or Sort operations cannot be done on column(s) whose key length is unknown or exceeds 10 KB. hi, guys i have asp... -
California ballot sort algorithm?
>>>>> "Kevin" == Kevin Zembower <kzembowe@jhuccp.org> writes: Kevin> Here's a sure sign of someone with too much time on his hands: Kevin> I was... -
Sorting out sort
I'm trying to extract a column from a flatfile database and print it alphabetically. I can get the data out, but I can't get it to sort. The... -
[Q] Safari, Javascript and sort function
Hello, I'm looking for a script to sort a html table. On the web, I found a lot of js scripts to do that but none working with Safari. Someone... -
Zac Hester #2
Re: Sorting algorithm(s) used by PHP's sort function
"Shaunak Kashyap" <skashyap@intertechmedia.com> wrote in message
news:67746bb.0307241733.63a5649f@posting.google.co m...There's a lot of sorting algorithms used by PHP. It looks like the primary> Does anyone know what sorting algorithm(s) -- quicksort, mergesort,
> radix sort, etc. -- does PHP use internally in its sort function?
array sorting method is quicksort. I also found some use of mergesort.
Looking at the source, I found this:
<builddirectory>/ext/standard/array.c
This sets up the "hooks" for most of the array functions for use in Zend.
It looks like all of the sort methods rely on a sort_type == zend_qsort.
Doing a quick search for this in the rest of the source, returns this:
<builddirectory>/Zend/zend_qsort.c
If you look at this file, you can see the good ol' quick sort algorithm in
action. If you prefer a different algorithm, I'm sure you could replace the
quicksort algorithm, recompile PHP, and whammo!
If you're interested in developing extensions to PHP, the API is pretty well
documented in the manual and in "Programming PHP" by Rasmus Lerdorf. I wish
I had the time to tinker with PHP at this level.
Take care,
Zac
Zac Hester Guest
-
Shaunak Kashyap #3
Sorting algorithm(s) used by PHP's sort function
Does anyone know what sorting algorithm(s) -- quicksort, mergesort,
radix sort, etc. -- does PHP use internally in its sort function?
Shaunak Kashyap Guest
-
Curt Zirzow #4
Re: [PHP] Sorting algorithm(s) used by PHP's sort function
* Thus wrote Shaunak Kashyap (skashyap@intertechmedia.com):
Zend actually does the sorting, and its quicksort.> Does anyone know what sorting algorithm(s) -- quicksort, mergesort,
> radix sort, etc. -- does PHP use internally in its sort function?
Curt
--
"I used to think I was indecisive, but now I'm not so sure."
Curt Zirzow Guest



Reply With Quote

