Update linkedlist.h

fixing duplicate code