It took me 10hrs to understand the concept of linkedlist but now I am fully confidence 🥺🥺🥺
@anonymous090
2 жыл бұрын
from where you have learnt? only through the video or from other resources too?
@TokyoWasTaken
2 жыл бұрын
*confident
@krishanusaha5332
2 жыл бұрын
*confident
@anonymous090
2 жыл бұрын
@@playwithlogic okay. Thank you
@daymand22
2 жыл бұрын
@@anonymous090 have you handled tail , when delete last node
@ritikamehta9791
2 жыл бұрын
The consistency and the content of this course is lit!!🔥🔥🔥
@avishkarpatil5871
10 ай бұрын
Comment at 1:36:22- Don't forget this crucial edge case! Hey everyone, just a quick heads-up! In the code provided, there's a crucial edge case that was almost missed. To ensure the correct functioning of this deleteNode function, please remember to include the following line: if(curr->next != NULL){ curr->next->prev = prev; // This line is essential to maintain the integrity of the linked list. } It's a small but important detail that should not be overlooked, especially when deleting a node from a doubly linked list. Happy coding!
@digvijaybhongale6807
9 ай бұрын
can u tell its order
@anujrithalia7797
8 ай бұрын
yah bro , i also came in comments sections to just see if anybody saw what i saw ....u are right its a small but big mistake
@GauravKumar-uj5dm
8 ай бұрын
i also noticed this
@shubhamgaming1641
7 ай бұрын
yes bro
@yashkum095
7 ай бұрын
yeah that's what I thought, there are 4 pointers associated with that node, but he deleted just 3, I thought he might have missed it thinking of just the tail deletion case.
@coderfek
Жыл бұрын
Clean lectures. Just wanted to point out one thing. At 55:00 instead of initializing temp->next = NULL or curr->next = NULL , just interchange the two lines in the deconstructor code and put them in order so, this->next is first initialized to NULL and then its deleted. Thank you!
@@adnanahmad1234 ye to sir vala hi code hai explain to kar ise
@adnanahmad1234
Жыл бұрын
@@devjindal8309 this->data current node ke data ki value assign kar rha. aur if condition ye check kar rhi ki current pointer ka next node null hai ya nhi. agar null nhi hai to use null set kar de rha, means null set Karne ke baad pointer break ho gaya purane wale node se. phir humne delete next kya to dobara recursive call hua jisse subsequent node agar present hain wo free ho jaayein. I guess yahi hoga jitna much samajh aaya !!
@devjindal8309
Жыл бұрын
@@adnanahmad1234 @adnanahmad1234 humne delete next kyo kiya. Next me to agli Vali node ka address hai to next node delete hogi na usse to par hame to current node ko delete karna hai na so hamne delete this kyo nahi likha.
@shubhampatel_2745
Жыл бұрын
1:35:38 here love bhaiya forgot to tell about we have to also change the curr -> next -> prev = prev we have to change this as well if we are deleting any middle node apart from this lecture is super duper Awesome. Love from Bottom Of My Heart. edit-> spelling correction.
@harshalkahar5844
Жыл бұрын
Yess sir
@none2868
Жыл бұрын
Can someone please tell me whats wrong in my code for CLL? It doesnt add new element next to tail. For example in int main() I tried to insert node 5 next to node 3 but it doesnt work class node { public: int data; node* next; node(int data) { this -> data = data; this -> next = NULL; } ~node() { int val = this->data; if(this -> next!=NULL) { delete next; this -> next = NULL; } cout next = newnode; } } void printList(node* tail) { node* temp = tail; do { cout
@taruntanwar4216
Жыл бұрын
@@none2868 Error in do while loop. Make it-- while(temp != tail)
@pranavpote5856
Жыл бұрын
if we do this , then we have to handle the deletion of tail separately because when we want to delete the tail node then we would not have curr->next->precv as there would be no next node
@ChanakyaNitiPower
Жыл бұрын
👍
@tanmayghosh8311
2 жыл бұрын
58:40 here we pass the tail as ref argument and if prev->next == NULL then tail = prev; delete curr; ....rest of the code while (count < position) { prev = curr; curr = curr->next; count++; } prev->next = curr->next; curr->next = NULL; if (prev->next == NULL) { tail = prev; } delete curr; }
yar ya kar ka dakha ha but nai work nai kar rha ha
@abhinavtripathi8037
2 жыл бұрын
"Love babbar" is a Person who can teach anything to anybody in very easy way.
@I_Anupam_Pandey
2 жыл бұрын
Lecture 44 Attendance It is simply amazing you uploading 1 hour + content literally every other day
@vpnuser5399
7 ай бұрын
nearly 2.5 hour man
@therealartist9
6 ай бұрын
linked list is a hard topic for beginners and yaha par bhaiya ko thoda dheere dheere aram se dubara cheeze samjhana tha but bhaiya bhot fast chale gaye
@PIYUSHTAILORstillalive
2 ай бұрын
Merko toh esa nhi lga bhai...maybe jab video dekhna is not enough ,thoda self research also helps
@tusharsingh3063
Ай бұрын
Ha bhai
@PIYUSHTAILORstillalive
Ай бұрын
@@tusharsingh3063 theek bhai. Koi specific doubt jo toh comment krdo..aata hoga toh help kr dengey
@yashchourasia9555
Ай бұрын
bhai literally muje khudko vahi lag rha hai ki bhaiya thoda fast padha rhe hai
@amanassociation8745
Ай бұрын
Not good for beginners
@spspsp10101
2 ай бұрын
Suggestion: In the starting you may feel its too vast, but hold on, by the end of video it will become cakewalk for you.
@shivanshudahiya3087
Ай бұрын
was about to giveup after 1hr , your comment made me do it in one go.
@AbdulManan-yx6yv
2 жыл бұрын
At *55:00** - **55:30* After adding these line temp->next = NULL; and curr -> next = NULL; I think we don't need destructor after this.
@abhiramreddy416
8 ай бұрын
yes but its done to save some memory by deleting the nodes that arent required to us
@shahidmoideen5286
7 ай бұрын
but bro the destructor would delete next only if this->next !=NULL right but we've already made curr->next=NULL @@abhiramreddy416
@parthdeshwal4419
4 ай бұрын
why can't we just delete the nodes rather than setting them to NULL
@suvigyabasnotra7378
2 жыл бұрын
Long videos are unintentionally scary imo. Though, you may upload as per your convenience but sooner if possible! Try to finish this course by March itself with a video per day because Placement season is almost there. I'm on a re-run of your videos with the homework and will catch up again to the current video in a few days! You keep up your consistency and we'll keep ours!
@vasulibhai5202
Жыл бұрын
Did you get the placement brother?
@YoutuberMrYash
Жыл бұрын
@@vasulibhai5202 +1
@rohan3944
3 ай бұрын
Got placement?
@suvigyabasnotra7378
3 ай бұрын
@@rohan3944 Long ago! Right now in the office. 🫅🏻
@lsuremusic3787
2 жыл бұрын
LL is good concept and needs time to interpret as a beginner. i request sir to upload 1hr videos for concept related videos so that we get decent time to grasp it. 💓
@HustlersAcademy
2 жыл бұрын
The best DSA course ever 🔥🔥 consistent from day one ❤️
@GauravYadav-wt2yw
Жыл бұрын
Have you done this course completely?
@sourabhchouhan8449
Жыл бұрын
explain me, what is the use of destructor here??
@shahrukhshabbir9877
Жыл бұрын
@@sourabhchouhan8449 for delete a node
@4nuragKr
Жыл бұрын
Instead of writing shouldn't we write and shift the line before . Any ideas anyone ?
@Alokankit627
10 ай бұрын
@@sourabhchouhan8449 destructor is used to remove the constructor that gets created automatically after creation of object but you need to call destructor when you make object dynamically but if the object created statically then there is no need to call destructor as constructor created after static declaration of object removes automatically after the last line of code. Correct me if i am wrong:
@topdog4616
Жыл бұрын
Thanks bhaiya I never thought of writing codes of linked list myself. But now I am confident to do it
@ateeshkumar8166
Жыл бұрын
I have a suggestion for InsertAtTail: void InsertionAtend(Node* &head ,int data){ Node * ptr = head; while(ptr->next!=NULL){ ptr = ptr->next; } Node*temp = new Node(data); temp->next=NULL; ptr->next = temp; } in this case we have no updation of tail when we are inserting from mid or head
@snehagupta7035
11 ай бұрын
Wow , i was having mistake here thank you for this suggestion
@iEntertainmentFunShorts
2 жыл бұрын
Finished today with my basics of linked list in Cpp
@sohammukherjee1392
Жыл бұрын
At 57:20, while deleting if we delete the last node then tail points to an absurd location and tail->data will give error. Before doing prev->next=curr->next, apply this if(curr->next == NULL) { tail=prev; }
@adityaraj04
Жыл бұрын
This Doesn't work for me
@abhisheknigam2278
9 ай бұрын
@@adityaraj04 pass the tail as an argument in deletenode function and check it.
@ashfaqhussain761
2 жыл бұрын
Rating : 5/5 For your consistency and content of the video
@somadityasingh2318
2 жыл бұрын
While deleting the node in between from DLL, apart from linking prev. node's next to the node after current node, you will also have to link that node after the current node to the previous node since its a DLL. current -> next -> prev = current -> prev.
@DeepakKumar-uh9yn
2 жыл бұрын
bhai DLL ka deletion ka code bhejo na ,I am unable to understand for the middle and last node in DLL deletion.
@hitececourses4062
2 жыл бұрын
this code will break for last node
@Gauravraj1098
2 жыл бұрын
@@hitececourses4062 ha to last node ke liye if laga ke itna hi code likhenge jitna bhaiya ne likha hai
@vaibhavsingh4108
2 жыл бұрын
@@DeepakKumar-uh9yn void deleteNode(int position,Node* &head ,Node* &tail){ if(position ==1){ Node*temp = head; temp->next->prev = NULL; head = temp ->next; temp->next = NULL; return; } else{ Node* curr = head; Node* previous = NULL; int cn =1; while(cnnext; cn++; } if(curr->next == NULL){ //setting previous -> next = current -> next = NULL; previous->next = curr->next; //broking the link between current node and the previous node; curr->prev = NULL; //updating the tail to the previous node; tail = previous; delete curr; return; } //for deleting between the elements; curr->prev = NULL; previous->next = curr->next; curr->next = NULL; delete curr; } }
@vaibhavsingh4108
2 жыл бұрын
after performing operation cout data
@ayushkushwaha171
2 жыл бұрын
Currently on your recursion videos. Will catch up soon! Thanks for your efforts💯🔥
@sonammalik17
Жыл бұрын
instead of writing temp->next = NULL and curr->next=NULL we should simply change the destructor code like this : ~Node() { int value=this->data; // memory free if(this->next!=NULL) { this->next=NULL; } cout
@marveldbs3001
Жыл бұрын
Can you explain how destructor is working when the node next is already NULL plzz🙏🏻🙏🏻🙏🏻🙏🏻
@reddragons3959
Жыл бұрын
in this video if condition is wrong which is (this->next==NULL) and you have to delete just a pointer variable which is next not 'this', "this" pointing the actual data which is static and you have to delete manually just a dynamic variables not static variables in c++ i hope you getting my point 😀
@reddragons3959
Жыл бұрын
@@marveldbs3001 in this video if condition is wrong, right one is which is (this->next==NULL)
@bhavya_21_12
7 ай бұрын
What i learnt: in the InsertAtMiddle function of linked list, if the position for new node to be inserted at is at the end, Then we have to take care of updation of our tail(if any) also in the function. for that, we just have to check that after while loop if temp->next==NULL If yes, then we just call InsertAtTail function And return
@Ayush-1911
3 ай бұрын
2 din procastinate krne ke baad finally i am here!
@rishabhmohan_
2 жыл бұрын
Best DSA course available on KZitem right now 🔥🔥🔥... Hats off Bhaiya
@AkhtarKhan-gk6ot
Жыл бұрын
58:50 Homework : Last Node Deletion how to place tail at right position void deleteNode(Node *&head, Node *&tail, int pos) { // Deleting Start or First Node if (pos == 1) { Node *temp = head; head = head->next; temp->next = NULL; delete temp; } // Deleting Middle or end Node else { Node *curr = head; Node *prev = NULL; int cnt = 1; while (cnt < pos) { prev = curr; curr = curr->next; cnt++; } prev->next = curr->next; curr->next = NULL; delete curr; // Placing Tail at it's right postion if (prev->next == NULL) { tail = prev; } } }
@Harshjj738
Жыл бұрын
I need help in coding question plz u help me ..? Telegram user id so I take help from u plz .
@priyankpatel1580
Жыл бұрын
tnx bhai for solution
@shashanksingh4968
2 жыл бұрын
Bhaiya jitne din nhi daal paye the aap video, use compensate kar dia is video ne, it took me about 3 days to finish grasping content with hands on and understanding. I always feared LL. Waiting to get better at it. :) Thank you for your efforts.
@vinayaksharma-ys3ip
2 жыл бұрын
Best Series....even better than many of the paid courses!!!
@shaileshkaiwart7190
Жыл бұрын
You are GOD for beginners. 🎅 Even a non-CS branch learner can develop a good understanding of DSA by watching your lectures.
@JalalUddinMdAkbar-tc5ds
Жыл бұрын
you deserve atleast 5 million subs brother, really appreciate your work! Thank you from Bangladesh
@MrFaraziOfficial
Жыл бұрын
no doubt bro
@rupalrajan2751
Жыл бұрын
ek baar mushkil lga shuru me bilkul smjh ni arha tha but dheere dheere confidence tha bhaiya haii smjh a jayega and dekho kuch 30 mins ki video k baad sb logic khud bnane agye!
@nishantzaveri2710
Жыл бұрын
Sir i feel instead of adding these unnecessary lines at 55:20 in DelNode func we can directly write this logic in destructor ~Node(){ int value=this->data; if(this->next!=NULL){ this->next=NULL; ⬅ delete next;⬅ } cout
@techacts
Жыл бұрын
Bro isne 24:35 print function kyo use Karo
@nagalakshmi6804
11 ай бұрын
Bro why we use this->next!=NULL
@vijaymaurya9755
2 жыл бұрын
Kaafi lambi video thi but finally complete kar li 4 to 5 hours mai with notes and codes 🤗 thank you for outstanding video 😍 Explored so many video but itna knowledgeable video nahi mila koi bhi 🤩 Bus notes available karado bhaiya 🙏🏻really help ho jaayegai 😇
@HoorulainAsad
3 ай бұрын
Better than college teachers with PhD degrees ❤❤❤
@ashreekar4896
2 ай бұрын
In circular linked list if we give a element to refer which is not in the list then code will run forever so for safety also add current ->next != tail inside while loop
@ritikasinha163
2 жыл бұрын
Best course seriously I had gone through many but this is superb thank u bro
@electro1146
Жыл бұрын
Did'nt fully understand LL at once but understood it clearly when implemented it myself.
@WisdomInfopedia
2 жыл бұрын
Bhaiya aapne jo dsa course banaya hai vo kisi bhi paid course main bhi itane achhe se nahi samjhaya hai thanks bhaiya course free main provide karne ke liye ♥️♥️♥️♥️
@mawalibhai636
11 ай бұрын
For handling Tail: Hint : wite this inside while loop if(curr -> next == NULL){ tail = prev; // if the next is null and current node is to be deleted then the tail becomes the previous element }
@NiteshKumar-dn4em
8 ай бұрын
thank you
@Sonamchaurasia19945
2 жыл бұрын
This type of dedication is needed I want in myself
@sourabhsutar7331
Жыл бұрын
Watched 3 times then crystal 🔮 cleared the concept thank you @Love Babbar
@panditji3440
Жыл бұрын
At 55:14 , i think code of destructor is wrong....bcz in the loop of destructor you are deleteting the node which is pointed by next but you have to delete the next node....thats why you got those errors but you are changeing your next to null before reaching destructor......thats why the loop of destructor will never get in run.
@therealartist9
6 ай бұрын
for better explaination you all can refer the apna college channel they are giving better expalanation than love bhaiya , in some circumstance only single teacher can not tell everything in an effective manner so try to switch according to topic
@ntrsdiaries3928
2 жыл бұрын
finally completed this video....hats off to your hardwork 🙏🙏🙏🙏
@10giteshzope76
2 жыл бұрын
Babbar bhaiya with a new Linked List video and New haircut: Mogambo khushh hua😂😂
@kushalgupta2041
Жыл бұрын
1:35:10 , I think you have to also change the previous data of next node of current node in doubly linked list
@@diveshkumar3823 yes I think this is the right code for this problem
@electro1146
Жыл бұрын
yes bro, I think he missed it.
@samaytopre5
Жыл бұрын
@@diveshkumar3823 yes ,u r correct
@user-sb3ld5nx8k
6 ай бұрын
this concept is not so simple , but you make it simple
@mdtausifalam5051
2 жыл бұрын
i just love the way you teach and cleared all the the complex part with an ease. kudos to you
@mokshdhall1453
2 жыл бұрын
Solution of tail capture garbage value when we delete last position. void delete_from_pos(node* &head,node* &tail,int pos) { node* curr=head; node* prev=NULL; if(pos==1) { head=curr->next; curr->next=NULL; delete curr; } else { int i=1; while(inext; i++; if(curr->next==NULL) { tail=prev; } } prev->next=curr->next; curr->next=NULL; delete curr; }
@laksheybanga8106
2 жыл бұрын
Bhaiyaaaaà your course is of next level maan 😭. Trust me no one can beat you in this field and reach aaegi tagdi iss course ki. And thanks bhaiyaaaaa. Agr time mile to bhaiyaaa reply kr dena.. waiting for your reply
@girish8023
2 жыл бұрын
The best DSA course ever 🔥🔥 consistent from day one
@gauravpawar5409
8 ай бұрын
Searching for the best lecture for linked list and got this best video.......... Thank you sir 🤩🤩
@harshalkahar5844
Жыл бұрын
1:35:01 & 1:38:40 Updated Tail with doubly Linkedlist // update tail if (curr->next == NULL) { curr->prev = NULL; tail = prev; prev->next = NULL; delete curr; } else { curr->prev = NULL; prev->next = curr->next; curr->next->prev = prev; curr->next = NULL; delete curr; } & Sir forget to write curr->next>prev=prev; Because each & every node has two pointers in case of doubly Linkedlist.
@none2868
Жыл бұрын
Can you please tell me whats wrong in my code for CLL? It doesnt add new element next to tail. For example in int main() I tried to insert node 5 next to node 3 but it doesnt work class node { public: int data; node* next; node(int data) { this -> data = data; this -> next = NULL; } ~node() { int val = this->data; if(this -> next!=NULL) { delete next; this -> next = NULL; } cout next = newnode; } } void printList(node* tail) { node* temp = tail; do { cout
@amanbisht7053
9 ай бұрын
where to write this code please tell
@sal2054
2 жыл бұрын
1:38:00 In deletion of any middle node in Doubly Linked List why don't we did curr->next->prev=NULL;
Please explain that memory-free code in the destructor!! Content is amazing!!!
@suchetapal713
2 жыл бұрын
1->2->3->4->5 If we want to delete the 2nd position, then first, make '1' point to '3' then assign next of '2' as NULL. In case, we forget to make it null, according to this destructor, all the nodes next to '2' will also get deleted. Run this code for reference: #include using namespace std; class Node { public: int data; Node* next; Node(int d) { data = d; next = NULL; } ~Node() { int v = this->data; if(this->next != NULL) { delete next; next = NULL; } cout
@Harshffx
Жыл бұрын
@@suchetapal713 how to update tail pointer in case of delete at end i update tail pointer as previous but that not working
@user-zg3ru3hs2j
Жыл бұрын
@@suchetapal713 in which concept or topic he explain about " ->" concept plz tell me
@suchetapal713
Жыл бұрын
@@Harshffx This is what I have written, u can compare with it, otherwise u can paste your code here void deleteNode(Node *&head, Node *&tail, int pos) { Node *prev = NULL; Node *current = head; int c = 1; if (head == nullptr) { return; } if (pos == 1) { head = current->next; current->next = NULL; delete current; return; } while (c next; c++; } if (current->next == NULL) { tail = prev; } prev->next = current->next; current->next = NULL; delete current; }
@suchetapal713
Жыл бұрын
@@user-zg3ru3hs2j You can refer to lecture 25 (Pointers) and then to lecture 42 (OOPs)
thank you so much i was doing ( tail-> data = previous -> data). ans now understood what was happening in behind.
@tulikaagrawal6090
3 ай бұрын
can you also explain the working of destructor with an example it will be very helpful to me
@harshbindal8590
Жыл бұрын
Video time 55:58 When we delete the last node The tail position will change so we put a condition Just After Line code 108 prev->next = curr->next if(prev->next == NULL){ tail=prev; }
@srinisenu1152
Жыл бұрын
thank you bro
@Veloxofcl
11 ай бұрын
When im trying to print tai l-> data in main function its showing garbage value. Plz help me
@harshbindal8590
11 ай бұрын
@@Veloxofcl you didn't change the position of tail or it is point to the null so it will give the garbage value.
@amanbisht7053
11 ай бұрын
thanku bro
@codetackle9662
2 жыл бұрын
best video on youtube on linked list i watched u explain a concept easily and clearly keep making such type of video ..
@satvikshukla596
2 жыл бұрын
Was eagerly waiting for linked list 🎉🙏
@priyanshpatel2078
2 жыл бұрын
After giving my 12 days of this video Now i can say that I have hands on Linked List
@arjunyadav-kt5jr
Жыл бұрын
wow man, you really gave it all to get a good hold of it !!
@bellalmahtab8220
Жыл бұрын
Bro u are talking about complete playlist or this video onlye
@priyanshpatel2078
Жыл бұрын
@@bellalmahtab8220 only this video
@hitececourses4062
2 жыл бұрын
1:35:55 Delete node in doubly LL void deleteNode(Node* &head, Node* &tail,int position) { // check if linked list is empty if(head==NULL) return; Node* p=head; Node* q=NULL; int cnt=1; // for deleting first node if(position==1) { p->next->prev=NULL; head=head->next; p->next=NULL; delete p; return; } while(cntnext!=NULL) { q=p; p=p->next; cnt++; } // check if position is out of range if(cnt!=position) return; // for deleting last node if(p->next==NULL) { q->next=NULL; p->prev=NULL; tail=q; delete p; return; } // deleting any middle node q->next=p->next; p->next->prev=p->prev; p->next=nullptr; p->prev=nullptr; delete p; }
@suranjandhara7535
2 жыл бұрын
Aa gya hu bhaiya....❤️❤️❤️❤️❤️❤️❤️ Lunch ke baad dekhunga ... Aur pura complete karke hi rahunga 💯💯💯💯..... Thank you bhaiya for providing such amazing content ......❤️❤️❤️❤️😘😘😘😘😘😘😘👋
@matilda3990
2 жыл бұрын
Thankyouuuuu, Bhaiya for this video but please wait for two days to upload the next video. I am loving your teaching! You are the best DSA teacher ever. ❤
@AnuMessi10
2 жыл бұрын
Finally LL, what a series 💥💥💥
@Unstoppable.Sakshi
Жыл бұрын
For Tail is showing garbage value - we will add a condition inside deleteNode() method and take one more argument tail as -> condition-- if(prev->next ==NULL) { tail=prev; tail -> data = prev -> data; } and method as -- void deleteNode(Node* &head,Node* &tail, int position){}
@ManifestingAcademicComeback
7 ай бұрын
What i learnt: if we have an empty linked list, i.e., head=NULL; Then while making the functions InsertAtHead or InsertAtTail (if any), we have to take care of this case. if(head==NULL) or if(tail==NULL) we simply make a node, and assign head or tail equal to this node
@ManifestingAcademicComeback
7 ай бұрын
Also i learnt: in circular linkedlist While writing the deleteNode function We have to take care of the case before deleting the curr node (which is equal to target value) that if(curr==tail) If yes, then we move the tail forward or backward After that only we delete curr
@ankuryadav2891
2 жыл бұрын
Best DSA course ever🔥🔥🔥
@prathyyyyy
2 жыл бұрын
nice and informative video bhaiya hope your community and youtube videos reach max!!! lots of love from tamilnadu!!
@nishagawade3545
Жыл бұрын
Inserting at a position greater than length mein shayad aapka code work na kare qki aapne vo case consider nahi kiya, rest of the things explained very well!!
@pratyush2454
3 ай бұрын
insert in the middle can also be written as void insertAtMid(Node *&head, int position, int d) { if(position==0){ insertAtHead(head,d); return; } Node *temp = head; for (int i = 1; i < position; i++) { if(temp->next==NULL){ coutnext = temp2; } it is easy to understand
@anmolkumar09
2 жыл бұрын
Currently on your LinkedList day 1 videos. I Will catch up soon! Thanks for your efforts💯🔥
@sourabhchouhan8449
Жыл бұрын
explain me, what is the use of destructor here in singly linked list??
@Yatishpujara
10 ай бұрын
@@sourabhchouhan8449 no idea bro , he is confusing it too much
I have a doubt, sorry if it is a basic doubt, at 29:10 , in head and tail both pointers objects contain node1, so even if we pass head to insert at tail it should work , why only tail should be passed to insetAtTail and head should be passed to InsertAtHead. Functions, here there is only one node that node1 , so that will be the head and that will only be the tail also. Can anyone clarify my doubt?
@animeshojha7435
11 ай бұрын
because tail pointer is moving forward while inserting the values , it will point to the last element in the linked list ,, while head is still pointing to the first value .
@BhaiRayyanKiDuniya
2 жыл бұрын
Bhaiya well done bhaiya. So nice of you to be doing things so well!!
@Rakib Mondal bhai aapko prev->next=curr->next likhne ki need nhi h last node ko delete krte time simply prev->next=NULL; But mera code nhi chal rha void deletefromtail(Node* tail,Node* head,int position) // deleting in linkedlist { if(position==1) { Node* temp=head; head=head->next; temp->next=NULL; delete temp; } else { Node* curr=head; Node* prev=NULL; int cnt=1; while(cnt < position) { prev=curr; curr=curr->next; cnt++; } if(curr->next==NULL) { prev->next=NULL; tail=prev; } else { prev->next=curr->next; curr->next=NULL; } delete curr; } } output- 12 20 30 head 12 tail 1662160
@rajankhunt7002
2 жыл бұрын
Thank You
@angshumanvlogs2613
2 жыл бұрын
its not working
@angshumanvlogs2613
2 жыл бұрын
@@priyamtiwari391 Hey You could try this condition if(pos=cnt) { tail=prev; prev->next=curr->next; }
@GAURAVSINGH-mm4kh
Жыл бұрын
@@ResilientFires this is correct 💯
@vanshikagupta5956
2 ай бұрын
bahut jaldi jaldi padha diya
@WebCoderAbhishek
2 жыл бұрын
Bhaiya pura movie 🍿 dekhne jaisa laag raha hai lekin bahut badhia banaya apne bhaiya love you babbar bhaiya from the core or heart
@amrinderprajapath1170
2 жыл бұрын
during deletion of node in doubly linked list you haven't changed the cur->next->prev it is still pointing to that deleted memory block
@vinitdubey4988
2 жыл бұрын
but after changing cur->next->prev=prev there is no output
@daymand22
2 жыл бұрын
If you complete this lecture properly , you have no single doubt in linked list. 🙌🙌
@shashwathbhaskar673
2 жыл бұрын
void deleteElement(Node * &tail,Node* &head, int position, int cur = 1){ if (position == 1 ){ Node * temp = head; head = head->next; temp->next = NULL; delete temp; } else{ Node * curr = head; Node * temp = NULL; int cnt = 1 ; while (cnt < position){ temp = curr; curr = curr->next; cnt++; } temp->next = curr->next; curr->next = NULL; if (temp->next == NULL){ tail = temp; } delete curr; } } Home work done bhai !! mast video , was struggling with linked list but now I think I can use it properly and have understood the concept and code .
@tanmayghosh8311
2 жыл бұрын
1:36:30 i think a forth line of deletion of this also should be added :- curr->prev = NULL; prev->next = curr->next; curr->next = NULL; prev->next->prev = prev;
@Awakk3n
2 жыл бұрын
yes u r corrct it is missed by @CodeHelp
@rishavrishu3809
2 жыл бұрын
@Tanmay Ghosh You are right, but there is slight error in your code . I think it will be - curr -> prev = NULL; prev -> next = curr ->next; curr -> next -> prev = prev; curr -> next = NULL;
@user-zg3ru3hs2j
Жыл бұрын
@@rishavrishu3809 in which concept or topic he explain about " ->" concept plz tell me
@sangrambiradar9461
2 жыл бұрын
"Getting into a habit is hard at first, messy in the middle and gorgeous in the end "(Robin Sharma) #Linked List #DSA
@aditya_0524
2 жыл бұрын
bro plz tell me that how should I update the tail after deleting it
@sangrambiradar9461
2 жыл бұрын
@@aditya_0524 Bro simply update your tail pointer to the last node
@aditya_0524
2 жыл бұрын
@@sangrambiradar9461 whats the code bro🤷♂️
@sangrambiradar9461
2 жыл бұрын
@@aditya_0524 // Deleting the nodes code void deleteNode(int position, Node* &head,Node *&tail) { // deleting the startnode if (position == 1) { Node *temp = head; head = temp->next; temp->next = NULL; // freee the head node delete temp; } else { // deleting the middle or last node Node *curr = head; Node *prev = NULL; int count = 1; while (count < position) { prev = curr; curr = curr->next; count++; } // deleting the last node if (curr->next == NULL) { prev->next = NULL; tail = prev; delete curr; return; } prev->next = curr->next; curr->next = NULL; delete curr; } }
@aditya_0524
2 жыл бұрын
@@sangrambiradar9461 thnx😃
@Pikachu10-19
2 жыл бұрын
Finally ,we are in the part I've beeen waiting for . Great consistancy bhaiya 🙂❤
@tejasvinityagi676
2 жыл бұрын
I thought its me who is finding this topic so difficult..... Pr sbka yhi haal h
@amandwivedi976
2 жыл бұрын
Bhaiya you are ideal for me I bet ek din aap mera interview penge issi channel pe mai bataunga ki aapki mehnat bekar nhi hamare liye,🔥🔥😍😍
@devcodez
2 жыл бұрын
Very Supportive classes bhaiya and best content in you tube AND also a great quote in description. 3 IN 1
@KumarDinesh-zw2vq
3 ай бұрын
Phirse dekhna padega video. Fell nahi aaya properly on some concepts
@anuragpatel7787
7 ай бұрын
finally in 2 days i completed this
@pddubey22
Жыл бұрын
Subah se lga hoon abb jake single list samajh aaya hai ....vo bhi Cristal clear......(*first time reading about linked list) 🥲☺️
@rachit_joshi
5 ай бұрын
Thank You So Much BHRATA SHREE !!!!
@therealartist9
7 ай бұрын
guys for better explanation , i would suggest to go with code with harry , he has explained each and every step slowly not wasted time on creating diagrams
@paksharaj4282
7 ай бұрын
link dena bhai konsi video harry ki
@rohan3944
3 ай бұрын
Code with Harry channel name
@Rizwanpandit
3 ай бұрын
Diagram se hi toh samaj ayega
@preetivishwakarma5340
2 жыл бұрын
One of the best course of DSA on youtube❤
@vaibhavkumar9624
Ай бұрын
in curcular linked list your node will point to first first node always, that's why your print function is printing linked list form first node otherwise do while loop will print last node first.
Пікірлер: 1,3 М.