Circular Singly Linked List (Deleting the Intermediate Node)

preview_player
Показать описание
Data Structures: Deleting the Intermediate Node of a Circular Singly Linked List
Topics discussed:
1) C program for deleting the intermediate node of a circular singly linked list.

Music:
Axol x Alex Skrindo - You [NCS Release]

#DataStructuresByNeso #DataStructures #CircularLinkedList #LinkedList
Рекомендации по теме
Комментарии
Автор

Hey Neso. I want to say that you do a great job and even if people don`t donate and you don`t get paid you make a difference in the world by helping engineers / teaching which helps the community. Thank you for your time and effort!

gamar
Автор

Sir please upload more videos of control system

manishkumarmeena
Автор

Sir please videos of coding interview questions on data structures topic wise
Like first some coding questions on arrays then some questions on stacks and so on...

Flash-qroh
Автор

i am not understanding why pos variable is put in the while loop as pos>2; how do we assume that the position entered by the user in the main function not less than 2?

rohandeb
Автор

imo this piece of code would work for any position 1st too.

// ---delete a node at a certain position---
struct node *delAnyPos(struct node *tail, int pos)
{
if (tail == NULL)
return NULL;
if (tail->next == tail)
{
free(tail);
tail = NULL;
return NULL;
}
struct node *temp1, *temp2;
temp1 = tail->next;
if (pos == 1)
{
tail->next = temp1->next;
free(temp1);
temp1 = NULL;
return tail;
}
pos--;
while (--pos)
temp1 = temp1->next;
temp2 = temp1->next;
temp1->next = temp2->next;
if (temp2 == tail)
tail = temp1;
free(temp2);
temp2 = NULL;
return tail;
}

rishavsaha
Автор

What about the case when position of the node to be deleted is 1 .I think the code would change for that case too.

abhishektiwari
Автор

The same program is not showing the output
It is getting exited after the 2nd value of the linked list is given

sahilgoswami
Автор

Did anyone noticed that tail has address 3000 and and position has 4000
And now temp2 and tail both has address 4000😂

Adityasharma-oezp
Автор

Hello sir
sir what happened when user Enter 1 or 0 node want to delete kindly help me

shubhamkumar
Автор

if the position is < 2 code pooped.

SaywhateverI