jambo69
asked on
What collection should I use?
Hi,
I am trying to create a simple search engine and have got a crawler working that stores information of pages into a database. After the user inputs their search times I pull information out of the database and rank it with a certain algorithm. My question is this, I need to record certain information about ranking so I can produce the results ordered by their score. What woud be the best way to do this? I need title, description page and score to be stored for each page and for this information to be presented to me in order of score (highest to lowest).
Thanks in advance.
I am trying to create a simple search engine and have got a crawler working that stores information of pages into a database. After the user inputs their search times I pull information out of the database and rank it with a certain algorithm. My question is this, I need to record certain information about ranking so I can produce the results ordered by their score. What woud be the best way to do this? I need title, description page and score to be stored for each page and for this information to be presented to me in order of score (highest to lowest).
Thanks in advance.
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
You can use a TreeSet : all elements are always sorted.
http://java.sun.com/j2se/1.4.2/docs/api/java/util/TreeSet.html
http://java.sun.com/j2se/1.4.2/docs/api/java/util/TreeSet.html
Hi,
I think you could use LinkedList collection classes, and HashMaps along with it for faster data accesses.
http://java.sun.com/j2se/1.4.2/docs/api/
Regards,
Warturtle
I think you could use LinkedList collection classes, and HashMaps along with it for faster data accesses.
http://java.sun.com/j2se/1.4.2/docs/api/
Regards,
Warturtle
Thanks for accepting.
That keeps us answering your questions in the future.
;°)
That keeps us answering your questions in the future.
;°)
= simply perform:
Collections.sort(yourList_