title | date | draft | tags | categories | |||
---|---|---|---|---|---|---|---|
Algorithm4 Java Solution 1.3.27 |
2019-07-04 05:47:10 +0800 |
false |
|
|
Write a method max() that takes a reference to the first node in a linked list as argument and returns the value of the maximum key in the list. Assume that all keys are positive integers, and return 0 if the list is empty.
iterate throw the list, compare each value to the max value. then return the max value.