LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Algorithm used for Sort 1D Array


RavensFan wrote:

Attached is the updated code.  (I dropped an instance on itself to just show the icon I made symbolizing what it is doing.)

 


One more thing that you probably already found - you have a small bug in this code, the input to one of the comparisons (I didn't check the code enough to determine if it's the less than or the greater than) should come from the other shift register value.

0 Kudos
Message 31 of 33
(554 Views)

Ouch.  Thanks.  I missed that.  Must have touched off on the wrong wire when completing it.

 

Here is the update version, but the 2nd copy I made using build array method.

 

Early test results are showing similar times, but I'm rechecking before I post any results.

 

0 Kudos
Message 32 of 33
(540 Views)

Have you tried getting rid of the cases structures? Maybe marginally faster, something like below. (Sorry I could not use your code, as it was not importing correctly to LabVIEW).

 

Cheers,

mcduff

 

Snippet12.png

 

EDIT: The snippet below reduces to 1 add, instead of 2

 

Snippet12A.png

0 Kudos
Message 33 of 33
(518 Views)