#Average of linked list node
20 messages · Page 1 of 1 (latest)
⌛ This post has been reserved for your question.
Hey @lunar flame! Please use
/closeor theClose Postbutton above when you're finished. Please remember to follow the help guidelines. This post will be automatically closed after 300 minutes of inactivity.
TIP: Narrow down your issue to simple and precise questions to maximize the chance that others will reply in here.
nope, going to need a lot more info for that
ok give me one sec i'll send my code sorry about that
don't need code
need a proper description of what you're trying to do
then we can talk about code
ok
basically i have a class called rating with a constructor of String reviewerID and int rating. In my other class I have a linked list node that is a type of Rating I am trying to get an average rating from the rating class using the Rating linked list node
sounds like you want the average of the entire list, not just one node
iterate to add to a rolling sum and then divide by the amount of elements, that's how you get an average
ok thank you
(average of a node is illogical. averages are fundamentally over multiple values)
yeah my bad i meant how do i find the average of the entire list when it's in the type of an object and not a double or int
ok, thank you