Department of Computer Science
Principles of Programming II
Spring Semester 2012
Dr. Maury Eggen
Homework Laboratory Assignment 2:
Homework laboratory assignment five involves singly linked lists.
We shall write a general "nodes and references" unordered linked
list class which should have the following functionality:
- add a node to the front of the list
- add a node to the end of the list
- delete a node from the front of the list
- delete a node from the end of the list
- count the nodes in the list
- print the list (display the value portion of each node)
- search the list (return a boolean)
- delete a node with a particular value from the list (if present)
- find the maximum value of a node in the list (if applicable)
- find the minimum value of a node in the list (if applicable)
- return a new list containing the first n nodes of the original list
- return a new list containing the last n nodes of the original list
Once the unordered list is functional, write an ordered linked list
class which maintains the elements of the list in sorted order.
An ordered list is an unordered list, so ordered list will inherit from
unordered list and overload functionality as appropriate. Note: list
elements should be unique. In other words, if a value is already in
the list we should not add it again.
Make a folder entitled
youruserid.linkedlists
and place everything you
wish me to see in this folder. Copy the folder into my public directory on or before
the due date using the commend
cp -r youruserid.linkedlists /users/meggen/Public