Doubly Linked List (Deleting the First Node)

preview_player
Показать описание
Data Structures: Deleting the First Node of a Doubly Linked List
Topics discussed:
1) C program for deleting the first node of a doubly linked list.

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

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

Please upload full playlist as soon as possible this videos are very helpful to me for better understanding

palkeshjain
Автор

I have completed my diploma in Civil engineering and took a slide to CSE, your videos are too good and effective. I am going to watch every video of yours.
Thanks to you_ Neso Academy.

sundaystories.
Автор

thanks for continuing this playlist for so long and respect for u alot for such dedication in teaching

AshishVerma_Awesome
Автор

Such short and beautiful explanation.Thank you neso academy

nayanasagar
Автор

your videos are too good and effective.

Honeyrathore
Автор

Short and sweet explanation.Thank you❤️.

mihirvora
Автор

Thank you for giving best explanation i ever had☺

harshmistri
Автор

We can also write-

void deleteFirst(Node **head)
{
*head = (*head)->next;
free((*head)->prev);
(*head)->prev = NULL;
}

krb
Автор

Thnaks a lot for helping me in debugging my code 🧡

stocksTrading
Автор

If you use the head elimination process to delete all your nodes, the process will result in an error. This happens because this code isn't designed to delete when only one node is left. The following code would satisfy this type of situation:

struct NODE* DeleteNodeInHead(struct NODE *head)
{
if (head==NULL)
{
printf("The linked list is empty!");
}
else if (head->next==NULL) //SPECIAL CASE WHEN THERES ONLY ONE NODE!
{
free(head);
head=NULL;
}
else
{
struct NODE *aux=head;
head=head->next;
free(aux);
aux=NULL;
head->prev=NULL;
}
return head;
}

manuelavendano
Автор

This logic can also work ..
struct node* delFirst(struct node* head)
{
struct node* ptr=head->next;
ptr->prev=NULL;
head->next=NULL;
head=ptr;
return head;
}

nishaverma
Автор

Sir, I have completed learning c and data structures.(by your videos).I am 1st year cse student.(still the class haven't begin). Is this enough sir. Will start practicing in hackkerank from tomorrow.🙏🙏🙏 is this enough before college starts. Kindly reply sir.🙏🙏🙏🙏🙏🙏

dhayalanm
Автор

Sir lekin jo 1st method h agar m usme 1st node ko another pointer ptr se free (ptr ) karta hu or head ko next par le jakar or head ke prev ko null karke list ko print karta hu to ho jaati h sahi kyuki head ke null tak traverse karte h hum lekin agar hum ptr jo humne free kiya tha agar hum ptr->data print karenge to deleted node ka data print ho jata h
Iska mtlb to ye hua ki node delete nahi hui bas uska access head se chala gaya
To please bataye

anshulvishnaliya
Автор

2:28 we don't have to use the temp variable/pointer

okenk.
Автор

Sir please upload complete ds series 🙏

janhvitolambe
Автор

What if there is a single node only in the list

ahsanhussain
Автор

Why we aren't allocating head memory like malloc.

tradertrader
Автор

Dear Neso Academy , Please reply what is the difference between datastructures and advanced datastructures?

monicabattacharya
Автор

I came here to complete the whole DSA and saw till this only, 🤦‍♂️

btushar