Thank you, next! Linked List in C++; Lesson 5
Hope you are following us from our first post about linked list, if so! lets continue with our linked list lesson, if not, don't worry, you can start form the beginning, here are links for you to review our previous lessons: Linked List; Lesson 1 Linked List; Lesson 2 Linked List; Lesson 3 Linked List; Lesson 4 Alright! lets begin our fifth lesson i.e deleting node.Now this is a feature of linked list which array doesn't provide. You can always overwrite any value in array but you cant delete it, but linked list gives you the opportunity to do so. Say, you have a linked list of 4 nodes and you are tasked to delete a node from that linked list asked by user at run time (This code will be quite similar to insert node code). For this, you'll be codding del() as follows: void del() { node *temp = new node; //1 node *temp1 = new node; //2 node *temp2 = new node; //3 int pos;//4 cout << "\nEnter the node you want to d