October 9th, 2013, 12:44 PM
Question in link list
Hey how do you find total of inserted values in link list
And how do you find the lowest and highest values of the inserted values :confused:
October 9th, 2013, 03:11 PM
Simply traverse through the list. Add the value in each node to get the total and compare each node value to the lowest and highest values so far and save the appropriate value.
Exactly the same as you would do with an array of values.
October 9th, 2013, 03:53 PM
If you're using C++, all this code is already part of the Standard Template Library (std::list or std::slist, std::min_element, std::max_element and std::accumulate).
Up the Irons
What Would Jimi Do? Smash amps. Burn guitar. Take the groupies home.
"Death Before Dishonour, my Friends!!" - Bruce D ickinson, Iron Maiden Aug 20, 2005 @ OzzFest
Down with Sharon Osbourne
"I wouldn't hire a butcher to fix my car. I also wouldn't hire a marketing firm to build my website." - Nilpo