baxy77bax has asked for the wisdom of the Perl Monks concerning the following question:
So what would be the best approach to create those top 20 lists. I was thinking something along these lines:
Since i am looking for top 20 there has to be a score associated to each song. So i iterate through this list and using binary search try to see if and where each song should go . If i conclude that the song should be within top 20 i start copying my top20 array until i reach the position where my song should go, insert my song and copy the rest.
So my question is : Is there maybe a better way to do this (I am not looking for code just a discussion)
thank you
baxy
PS
this is not a homework though i described it as such :), therefore i don't need any code - basically this should be a variant of a google search engine, right?
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: top 20 song hits
by CountZero (Bishop) on Dec 01, 2013 at 16:49 UTC | |
|
Re: top 20 song hits
by oiskuu (Hermit) on Dec 02, 2013 at 00:58 UTC | |
by davido (Cardinal) on Dec 02, 2013 at 01:20 UTC |