Created a LinkedList class as a template class for further use.