2.15 Implementation of Circular linked list in C | Data Structure Tutorials

preview_player
Показать описание
Here I have written a C program to create a Circular Linked List and to display the content of that Circular Linked List. I have discussed the implementation of Circular Linked List maintaining only Tail pointer as well as both Head and Tail pointer.

******************************************
See Complete Playlists:

********************************************

Connect & Contact Me:

#circularlinkedlist #jennyslectures, #linkedlist, #datastructures
Рекомендации по теме
Комментарии
Автор

One thing I should mention..ur explanation is nice....u told the reason for every statement that why we are using...it's makes to remember about the concept easily..

ganavin
Автор

@Jenny I would like to suggest a couple of modifications to the creating circular linked list.
1. If you don't assign anything to newNoe->nex, it is going to remain Null. So I think that line is not required. Anyhow, if user is willing to continue, newNode->next would be assigned with some pointer.
2. instead of writing tail->next = head inside the loop, we can write it outside the loop. The. reason is if the loop is continuing, tail->next would be assigned with newNode's address. So I would be good if we don't run it recursively in the loop. It will reduce some time complexity :).

Sharing my code below, in my code, I've used temp instead of tail.
int choice = 1;
struct node * head = 0, *newNode, *temp;

while (choice == 1) {
newNode = (struct newNode*)malloc(sizeof(struct node));
printf("\nEnter the data for the node ");
scanf("%d", &newNode->data);

if (head == 0) {
head = temp = newNode;
}
temp->next = newNode;
temp = newNode;

printf("Do you want to continue (1/0) ");
scanf("%d", &choice);
}
temp->next = head;

@Jenny, correct me I've added anything wrong.

adityashinde
Автор

Thank you so much mam . I have been wandering around cause I was not sure where to learn DSA from . Now that I found your channel, I am completing the playlist with a lot of dedication and so much speed . Thanks a lot 😀❤

nagasrikuncharapu
Автор

mam you teaching procedure is amazing .I have no words to express how you help me. A request ;if possible please upload computer organization and architecture lectures. With regards

sukritisurupde
Автор

Myself piyush I am new in your channal from today your method to understand is a magic .
I can't believe could be a channal
Very good

dhananjaymishra
Автор

For me you are like..my teacher❤️..my family teacher like family doctor 😊 listening to ur voice..remembers me like childhood mam travelling through all my grades.... thanks for ur teaching jenny
Signing
Bhanoj Addala

bhanojaddala
Автор

thanks mam!!! your teach was phenomenal...thank you so much mam..

saiKiran-cfsd
Автор

Simply in love with your teaching made my lockdown useful after 4 months by you😅😅 and ur teaching 😊😊😊

saibathala
Автор

Mam, The way you Explain Things is too good. Thank You Soo Much Teacher.

rajatpandey
Автор

thanks guys! i understood more from your video than in class.keep it

codergonnacode
Автор

I have an exam on Friday plz everyone pray for me to get passing markk by watching this exceptional learning video❤

Zarbakht
Автор

instead of doing


while(temp->next != tail->next)
{
printf("data value: %d\n", temp->data);
temp = temp->next;
}
print("%d", temp->data);



just do



while(temp != tail->next)
{
printf("data value: %d\n", temp->data);
temp = temp->next;
}

coolgamingbird
Автор

Ma'am I only want to say that why did you not cover time complexiry and analysis part in DSA which is very important aas the perspective of placements as well as DSA learners.

AdityaRaj-duko
Автор

Mam the videos are very helpful for understanding the concepts.
Will be good if u can post some videos with algorithms also if possible 🙂

sheelsachania
Автор

Thank you very much ma'am. I am studying totally on your line. You have helped me so much. Stay blessed ❣️💗😚💗😚💗😚💗💗💗😚😚

thebrokeartist
Автор

Thank you mam for videos .Your teaching speed is best to get sufficient info about any topic.and also you have completed the course nicely than any other youtuber have done..

anchitsri
Автор

Very good explanation mam. Thank you so much ❤️

mdshanawaz
Автор

Ma'am you explain all complex problems in very very easy way ❤️❤️😘😘 thank you

sohamraghuvanshi
Автор

Guru bramma
Guru Vishnu
Guru Mahadev
Guru Jenny🙇🙇🥺🥺

yogeshyeshwanth
Автор

Mam..Could you please tell the time complexity difference between double link list, single linklist and circular linklist while adding, deletion at end and begining

soundsofanera