Before watching the solution in the previous video, I'd tried the EXACT same thing and was confused why it didn't work. Glad I got the explanation here.
Good evening sir! I usually use my Lappy to learn but l opened the playlist in my mobile just to like and support ur channel which helped me to understand DS in a better way 😊.... Waiting for ur next topics of ds sir... Lover for neso academy from Andhrapradesh
Sir I was also confuse about that i was thinking if I'm passing pointer to add_beg() then it is call by reference then why we should update the head. Thank your sir
True and in the main function we are able to print the data of the now first node which is 3. Malloc in the add_beg() function allocate memory in the heap section which is available even after the function terminates. Should we free all the memory allocated at the end of the code?
We could pass &head as a parameter to add_beg changing the type of the first argument to struct node** pointerToHead. Easier solution (perhaps a bad one?) would be to just put head in the global scope.
Damn Good yarr ! Fantastic representation and Expalnation.. Sir , you are Great.. We support you sir ..we love THE NESO ACADEMY ... LOVE FROM the whole Maharashtra....
oh my god you are legend. i exactly though of this when i watched just previous video. thank you for saving my life !!! now i am clear otherwise i also though its not necessay to do head =
hi neso academy...want to ask a question..we have allocated heap memory to head at the starting so it will not vanish out once the function will call of so how it could be pass by value..i m confused please explain.
Can we use functions of both adding_node_at_end and adding_node_at_beginning to create our linked list,I have tried this and i am getting some error , can anyone guide me in this
Instead of returning head, you could give head to the "add_beg(&head)" as a double pointer, this way you don't give the value inside of head, but the actually reference to head. In this case the code inside the function add_beg does need accordingly. For readability your way is certainly better. -edit nvm, you talk about this in the next video of the playlist.
Before watching the solution in the previous video, I'd tried the EXACT same thing and was confused why it didn't work. Glad I got the explanation here.
I love neso academy. I am fully support neso academy by heart and soul.
Sir plzzz increase the frequency of lectures!! 💗💝💗💝
Good evening sir!
I usually use my Lappy to learn but l opened the playlist in my mobile just to like and support ur channel which helped me to understand DS in a better way 😊.... Waiting for ur next topics of ds sir... Lover for neso academy from Andhrapradesh
@Dipen Rana l didn't get if l should consider it as a compliment or a comment....
What do you mean by support?
@@karthik9354 support may mean suggesting to few of my frnds which in turn increase the no. Of views to the channel
@@srivallimadduri1489 support from vizag
You're just awesome. I made this mistake and wasn't aware of this possibility. Kudos to you brother!! Keep producing good content. Thanks a lot
Best material so far I came across for link list
Sir I was also confuse about that i was thinking if I'm passing pointer to add_beg() then it is call by reference then why we should update the head.
Thank your sir
True and in the main function we are able to print the data of the now first node which is 3.
Malloc in the add_beg() function allocate memory in the heap section which is available even after the function terminates.
Should we free all the memory allocated at the end of the code?
i did this mistake and stuck for 30 min in the code then i decide to
continue the lecture and BOOM i got the solution😂
totaly clear my doubt in the last lecture
Please be consistent sir 🙏🙏🙏🙏🙏🙏
good evening sir,
I am from tech background and I love it
thank you love you
We could pass &head as a parameter to add_beg changing the type of the first argument to struct node** pointerToHead.
Easier solution (perhaps a bad one?) would be to just put head in the global scope.
Really really loved your content 💖💖💖💖
Sir your lectures are awsomes
Plz add the lectures of doubly linked list
That's exactly the mistake I was making ;-; THANKS ALOT NESO!
Damn Good yarr !
Fantastic representation and Expalnation..
Sir , you are Great..
We support you sir ..we love THE NESO ACADEMY ...
LOVE FROM the whole Maharashtra....
Linked stacks and queues application of linked list. Bro needed this. Can u make a video?
I love Neso Academy. 💝
oh my god you are legend. i exactly though of this when i watched just previous video. thank you for saving my life !!! now i am clear otherwise i also though its not necessay to do head =
Sir Can you teach about system call using C like fork(), exec() etc on unix and for Windows CreateProcess (), WaitForSingleObject()
hi neso academy...want to ask a question..we have allocated heap memory to head at the starting so it will not vanish out once the function will call of so how it could be pass by value..i m confused please explain.
Sir you are great...hoping next videos soon ..stay safe sir🙏
Please sir include some basic idea about system call using c or c++
sir, please add subtitle for your videos it really helps, thanks
Thats the exact mistake i made b4 cing this video ........thanx buddy
amazing work!!!
The use of a caboose is another way and it simplifies all the code. struct node *createList() {struct node *nd = malloc(sizeof(struct node)); nd->link = nd; return nd;}; void insertBefore(struct node *nd, int new_data) {struct node *new_nd = malloc(sizeof(struct node)); new_nd->link = nd->link; new_nd->data = nd->data; nd->link = new_link; nd->data = new_data;}; Now all the other functions get simplified : void add_beg(struct node *head, int new_data) {insertBefore(head, new_data);}; void add_at_end(struct node *head, int new_data) {struct node *nd = head; while (nd->link != nd) {nd = nd->link;}; insertBefore(nd, new_data);}; void add_at_position(struct node *head, int new_data, in pos) {struct node *nd = head; --pos; while (nd->link != nd && pos > 0) {nd = nd->link; --pos;}; insertBefore(nd, new_data);};
what if we declare head as global variable?
wont it be easy?
plzzz Plz add the lectures of doubly linked list
Sir pls provide english subtitles also sir
I made same mistake, when performing this myself
Can we use functions of both adding_node_at_end and adding_node_at_beginning to create our linked list,I have tried this and i am getting some error , can anyone guide me in this
then how about we just return ptr instead of head
I was doing this same mistakes 😢
just wow
Instead of returning head, you could give head to the "add_beg(&head)" as a double pointer, this way you don't give the value inside of head, but the actually reference to head. In this case the code inside the function add_beg does need accordingly.
For readability your way is certainly better.
-edit
nvm, you talk about this in the next video of the playlist.
wrrongg
👍🙂
grate
While writing the code i made this mistake🤣🤣
Sir please increase time also.videos are too short
Purse