2.If the new element is to be added to the beginning of the list, you will need to let the link of the new item points to the pfirst and then update the pfirst to point to the new item.
3. If the new element is to be added to the middle position of the list, you need to let a pointer point to the position immediately before the position that the new element will be placed in.
4. If the new element is to be added to the last of the list, you need to let the link of the plast point to the new element then update the plast to point the new element.
Note: After the new item was inserted to the list, the next link of the plast is pointed to the pfirst. By doing this, all items of the list are linked together circularly.//C code to add a new element to the circularly linkedlist
This website intents to provide free and high quality tutorials, examples, exercises and solutions, questions and answers of programming and scripting languages: