Refer Double linked list article which has the linked list source code you are looking for.