Can someone explain/show me how to find the oldestAge() in a Linked List that points to a reference to the object?
I would very be grateful for someone's help! Thanks!
Linked List: oldestAge() help...?
The basic idea is to traverse the entire list and find the oldest age:
int oldestAge (LinkedList list) {
int i, age, oldest=0;
for (i=0; i%26lt;list.size(); i++) {
age=list.getAge(i);
if (oldest%26lt;age)
oldest=age;
}
return oldest;
}
I hope this helps.
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment