Study Abroad Education Loan College News Placement Book Shops E - Books Engg-Admission Edu-Classifieds Students-Forum
Easy Studies
 « NS2  Projects »

Home Implementation Of Circular Linked list▼

## Implementation Of Circular Linked List:

In circular linked list the pointer of the last node points to the first node.

It can be implemented as singly linked list and doubly linked list.

1. It allows traversing the list starting at any point.

3. Circularly doubly linked list allows traversing the list in either direction.

Algorithm Steps:

Step 1: Create the pointers prev, cur ,last.

Step 2: Read the operation type of the list.

Step 3:  If the operation type is Insertion then

i) If insertion at beginning is true

1. Create the new node and allocate memory for that node.
2. Read the data in new nodes data part.
4. Assign first=cur (move the first to cur)
5. Assign last->link =first (now last -> link points new first node)

ii)  If insertion at between any two nodes is true

1. Move the prev pointer to required position
2. Create the new node and allocate memory for that node.
3. Read the data in new nodes data part.

iii)  If insertion at end is true

1. Move the prev is to last position ( ).
2. Create the new node and allocate memory for that node.
3. Read the data in new nodes data part.
5. Assing prev=cur.

Step 4: If the operation type is deletion then

i) If deletion at beginning is true then

4. Reallocate the cur from memory.

ii) If deletion between any two nodes is true

1. Move the cur to required position.
2. Move the prev to cur predecessor’s position.
4. Reallocate cur from memory.

iii). If deletion at ends is true

1. Move the cur to last position.
2. Move the prev to cur’s predecessor position
4. Reallocate cur from memory

Step 5: If operation type is traverses

1. Assign cur=first
2. Repeat the process untill cur becomes last Cur=cur->link
C Program To Implement Circular linked list

CPP Program To Implement Circular linked list

⇓ Student Projects ⇓
⇑ Student Projects ⇑