Anybody know a fast efficient sorting Algorithm

Quote:

> I solved this one myself. To achieve the sorting I used LV's own sorting

> function and the fact that when sorting clusters it will sort by the first

> element in the cluster. First my sorting function had to strip the data I

> wanted sorted by, out of my original array of clusters at the same time

> clustering it with the its index in the array. When the sorting is done the

> index can be used to reorder the array of clusters to the new sorted state.

> About a function calling itself. Possibly if the function was made reentrant

> and then the function loads itself using the 'Load VI' function or maybe the

> 'VI Server' functions. I havn't tried this but if anybody has email me. Tim.

> --== Sent via Deja.com http://www.deja.com/ ==--

> ---Share what you know. Learn what you don't.---

Quicksort is a recursive algorithm (i.e. it calls

itself.) Direct recursion where a VI calls itself

is not permitted in

labview. Self managed

recursion is possible.

You can find a quicksort implementation in G in the

the book "LabVIEW Power Programming". This example

uses a stack data structure and self managed

recursion to implement the algorithm.

Feel free to contact me for more information (I

wrote the quicksort example.)

Joe Damico

Sent via Deja.com http://www.deja.com/

Share what you know. Learn what you don't.