how to sort an array?

izza_azhar

Member
Joined
Mar 1, 2006
Messages
17
Programming Experience
Beginner
hye all,
how to sort an array and get the minimum value from it?
for example:
myArrayColumn = [1,5,1,2,9,.6.7.11,11.2.1]

actually i wanna get the 5 minimum value from the array?
how to do that?
may be we can sort the array and create another array that will store 5 different value = 1,1,1,2,2

anyone please give me some pse......aaaaaaaaa..
huhu~~~
 
Sorting

Damn, it looks like there is a sort function as previous posts have stated. I remember when this was done manually.

I am new to vb.net, so I cant say for sure. Anyone that knows please correct me..... but vb in the past (at least before .net, maybe still) was very slow using buillt in functions for anything.

How I sorted things was......... well excluding a c++ dll:

I used a loop. The loop compared CurrentIteration to CurrentIteration+1.
If the +1 needed to be re-organized (depends of ascending vs descending) then the swap was made and you drecreased the counter by 2. This decrease would allow CurrentIteration-1 to be compared to CurrentIteration+1 (which because of the swap is now CurrentIteration +0)

If I am confusing anyone, i can explain in more detail. But please, if you are more farmiliar to .net than I am, please (and I hope) tell me that it is much faster than VB6

Thanks.
 
Back
Top