Skip to content

Latest commit

 

History

History
25 lines (16 loc) · 517 Bytes

Ex_1_3_27.md

File metadata and controls

25 lines (16 loc) · 517 Bytes
title date draft tags categories
Algorithm4 Java Solution 1.3.27
2019-07-04 05:47:10 +0800
false
JAVA
TECH
archives

1.3.27

Problem:

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.

Solution:

iterate throw the list, compare each value to the max value. then return the max value.

Reference: