2008-06-15

Quick sort VI for LabVIEW

I have made a binary search library for LabVIEW few days ago and I found it is hard to sort an arry of any type.  So I made another VI to sort an array.



First, you need to create an VI to compare two values in advance of using the library.  The VI accepts two variants A and B, and returns the result of (A-B).  The VI should simply perform subtract B from A if you want to search a numeric array.  The VI, however, will be more complicated if you want to search an array of cluster.  Note that the VI must return 0 if matched.



Cmpint32




Then, pass an array of data type and the VI you have just created to SortAny1DArray.vi , and then you will get the array sorted.  The sorting algorithm is quick sort.



Qsort



Download lvqsort-0.1.zip