algorithm - Is there an easy way to have a "mode" function on an array of singles in vb6? -


I need to run "mode" (which is most often) on an array of singles in vb6 Is there a quick way on such large arrays?

See online for a decent implementation A sorting algorithm for VB6 (I do not believe there is any Is not even created!), Sort the array, and then count the events going through them (which will be straightforward because you have all the same items together in the array) - keep track of the things that happen most often on your way And you are done. It should be O (nnn) - which is fast fast - if you have used a decent sort algorithm (quick or similar).


Comments