data structures using figure shows the algorithm to search linked list in step we initialize the pointer variable ptr with start that contains the address of the first node in step while loop is executed which will compare every node' data with val for which the search is being made if the search is successfulthat isval has been foundthen the address of that node is stored in pos and the control jumps to the last statement of the algorithm howeverif the search is unsuccessfulpos is figure algorithm to search linked list set to null which indicates that val is not present in the linked list consider the linked list shown in fig if we have val then the flow of the algorithm can be explained as shown in the figure step [initializeset ptr start step repeat step while ptr !null step if val ptr -data set pos ptr go to step else set ptr ptr -next [end of if[end of loopstep set pos null step exit ptr here ptr -data since ptr -data ! we move to the next node ptr here ptr -data since ptr -data ! we move to the next node ptr here ptr -data since ptr -data ! we move to the next node ptr here ptr -data since ptr -data pos ptr pos now stores the address of the node that contains val figure searching linked list inserting new node in linked list in this sectionwe will see how new node is added into an already existing linked list we will take four cases and then see how insertion is done in each case case the new node is inserted at the beginning case the new node is inserted at the end case the new node is inserted after given node case the new node is inserted before given node before we describe the algorithms to perform insertions in all these four caseslet us first discuss an important term called overflow overflow is condition that occurs when avail null or no free memory cell is present in the system when this condition occursthe program must give an appropriate message inserting node at the beginning of linked list consider the linked list shown in fig suppose we want to add new node with data and add it as the first node of the list then the following changes will be done in the linked list