Deletion in singly linked list at beginningDeleting a node from the beginning of the list is the simplest operation of all. It just need a few adjustments in the node pointers. Since the first node of the list is to be deleted, therefore, we just need to make the head, point to the next of the head. This will be done by using the following statements. Now, free the pointer ptr which was pointing to the head node of the list. This will be done by using the following statement. Algorithm
Write UNDERFLOW C functionOutput 1.Append List 2.Delete node 3.Exit 4.Enter your choice?1 Enter the item 23 Node inserted 1.Append List 2.Delete node 3.Exit 4.Enter your choice?2 Node deleted from the begining ... Next Topic# |
We provides tutorials and interview questions of all technology like java tutorial, android, java frameworks
G-13, 2nd Floor, Sec-3, Noida, UP, 201301, India