Sunday, 1 September 2013

how do I find the average in a Java LinkedList?

how do I find the average in a Java LinkedList?

I have a LinkedList and its elements are books. Books have their prices
and a book can be added to the list repeatedly(un-ordered) and each time
when they are added their prices may vary. Now I have to find the best
selling book in the list by adding up all the different prices of the same
book and divide it by the number of occurrence in the list. I am having
trouble with the finding all the occurrence of the same book as they are
un-ordered.
can anyone give some ideas about this.
thank you.

No comments:

Post a Comment