in reply to Top and bottom 10 percent elements of an array

sesemin,
Why do you need to do this? Is the data you presented representative of your actual data? I ask because sorting to find the top/bot N is typically simpler but less efficient than say using a heap. This sounds like it might be a fun and interesting problem but I really wouldn't want to spend time beyond the solution ikegami provided without knowing more.

Cheers - L~R

  • Comment on Re: Top and bottom 10 percent elements of an array