View Single Post
Old Nov 28th, 2005, 11:58 AM   #22
groovicus
Programmer
 
Join Date: Nov 2004
Posts: 84
Rep Power: 4 groovicus is on a distinguished road
I don't know about hideously inefficient... it is O(N).

I would agree that it is not the most elegant way to do it though, and my method does nothing for ties.

EDIT: Actually, now that I think about it, if I populate both arrays at the same time, then it becomes O(1). And I think that you are describing essentially the same thing that I am, only it appears that with your method, each time you check the count, you have to traverse the array where you stored your count...

Unless I am totally misunderstanding your angle of attack, in which case I am always open to a fresh perspective.
__________________
HijackThis Team-SFDC

Last edited by groovicus; Nov 28th, 2005 at 12:21 PM.
groovicus is offline   Reply With Quote