ex4.cpp: finalized linked list implementation.