This for loop deserves some attention; for loop terminates on lp!=NULL
instead of the traditional counter.
Also the standard i++ is replaced with accessing the next node.
This is the basic loop operation for all linked list.

Singly linked list is the form of data structure where in all the
data elements in a list are interconnected and their operations are usually uni-directional.

Doubly linked list is the bidirectional form of data structure connections.