i want to know the program how to insert at the beginning of a circular linked list in C.

Recommended Answers

All 4 Replies

>i want to know the program how to insert at the beginning of a circular linked list in C.
Guess what? There is no beginning to a circular linked list. That's why it's called a circular linked list: because it is.

if u r askin for a code to insert a node before head node then
first create a temporary node, traverse the list using a condition "while(next->link!=head)", then assign the address of temporary node to next->link then shift next to this temporary node and at last assign the address of head to link part of this node, shift head at temporary node.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.