COS2611 Assignment 2
Semester 1 – 2021
Unique Number: 619240
Please note the Due date has
been updated since the
distribution of this document on
the myUnisa Website
, Question 1 – Linked Lists
template <class Type >
Type linkedList<Type>::max() {
nodeType<Type> *big;
nodeType<Type> *current;
big = first;
current = first;
while (current != NULL) {
if (current->info > big->info) big = current;
current = current->link;
}
return big->info;
}
Semester 1 – 2021
Unique Number: 619240
Please note the Due date has
been updated since the
distribution of this document on
the myUnisa Website
, Question 1 – Linked Lists
template <class Type >
Type linkedList<Type>::max() {
nodeType<Type> *big;
nodeType<Type> *current;
big = first;
current = first;
while (current != NULL) {
if (current->info > big->info) big = current;
current = current->link;
}
return big->info;
}