Lecture 49: Merge 2 Sorted Linked Lists || Sort 0s, 1s and 2s in Linked List

  Рет қаралды 239,768

CodeHelp - by Babbar

CodeHelp - by Babbar

Күн бұрын

Пікірлер: 392
@CodeHelp
@CodeHelp 2 жыл бұрын
Do Visit Relevel: relvl.co/4sx5
@myncom397
@myncom397 2 жыл бұрын
the code is not correct for test case [5] , [1,2,3,4].
@amitprakhar4802
@amitprakhar4802 Жыл бұрын
bhaiya ye TLE kyu de rha merge sort wala
@avishkarpatil5871
@avishkarpatil5871 Жыл бұрын
Approach 3 void sortArray(Node* head){ Node* temp = head; while(temp != NULL && temp->next != NULL){ Node* forward = head; while(forward != NULL && forward->next != NULL){ if(forward->data > forward->next->data){ swap(forward->data, forward->next->data); } forward = forward->next; } temp = temp->next; } }
@nxtlvl2904
@nxtlvl2904 Ай бұрын
Bubble sort se bhi kr skt hai n bhaiya
@fgh427
@fgh427 2 жыл бұрын
Babbar bhaiyya... I love you... Koii apna bhi itna help nhi karta jitna aap kar rhe ho.... Bhagwan aapko meri ummar bhi de de... Legend and GOAT....
@iamvishnuranjan
@iamvishnuranjan 2 жыл бұрын
Bhaiya 1 month me (1- 49 )lecture 😍 what a course..
@yashsonune4391
@yashsonune4391 2 жыл бұрын
Glad I have completed 1/3 of the series, and still continuing.
@parthdeshwal4419
@parthdeshwal4419 7 ай бұрын
how long did it take you ?
@Anmol-h8z
@Anmol-h8z 5 ай бұрын
at 41:15 while inserting a node between two nodes we can use : curr1->next=curr2; curr2=curr2->next; curr1=curr1->next; curr1->next=next2; and also why we are checking for next1->data >curr2->data > curr1->data we could just check with next1 only as we know we start with element with smallest value any value will be greater than or equal from starting node and then going further in list if curr2 is inserted and then new curr2 value will definitely greater than previous one
@harshitkumar197
@harshitkumar197 2 жыл бұрын
I coded the 2nd one merge two sorted array by myself. i looked at ur approach discussion and did by myself. thanks for the giving me the confidence
@therealartist9
@therealartist9 9 ай бұрын
in which company you are working ??
@tjstar390
@tjstar390 2 жыл бұрын
BOTH Questions have unique concepts and bhaiya explain it very well,Thanks bhaiya.
@RajveerKaur-ze1ll
@RajveerKaur-ze1ll Жыл бұрын
to check for the case when both elements have one one element, instead of adding a new if condition at beginning, we can also move the "if (next1==NULL)" condition outside the while loop, then also answer is correct, hope this helps.
@prashantbpkumar510
@prashantbpkumar510 Жыл бұрын
Exactly
@tanishsinghal1879
@tanishsinghal1879 11 ай бұрын
yeah boyh
@priyanshpatel2078
@priyanshpatel2078 2 жыл бұрын
20:00 We can Simply Handle it by using this steps p3->next=NULL; p2->next=twoHead->next; p1->next=oneHead->next;
@tusharmukherjeeju-cse5773
@tusharmukherjeeju-cse5773 2 жыл бұрын
Can't believe that someone dislike this video ! 🙂 💔 If you buy a course which takes from you 20k that course never give you that kind of explanation . Love from Kolkata ❤️🙌
@divyareddy7622
@divyareddy7622 2 жыл бұрын
why cant zero and two 's list be empty here? he only took the case when 1's list is empty
@visheshkaran7083
@visheshkaran7083 Жыл бұрын
@@divyareddy7622 because even if two's or zero's list are empty they will be null and onetail->next will be null so it won't make any difference.
@yashparalikar05
@yashparalikar05 Жыл бұрын
Your teaching and your explanations are absolutely exceptional!!!
@unboxtheuniverse5336
@unboxtheuniverse5336 2 жыл бұрын
Wahhh bhaiya 💥😃😃 DSA ki ab Video na dekhu to din productive nhi lagta 😃 Bhaiya plz *"5 Month Internship Strategy Series lao with DSA busted course as resource"* (for 2nd year students)🥺
@varaprasad8261
@varaprasad8261 Жыл бұрын
Node* sortTwoLists(Node* first, Node* second) { if(first == NULL)return second; if(second == NULL)return first; Node* temp = first->data > second->data ? second : first; if(temp==first) temp->next = sortTwoLists(first->next,second); else temp->next = sortTwoLists(first,second->next); return temp; }
@durgashreenv8426
@durgashreenv8426 8 ай бұрын
35:00 Explanation was just amazing, thank you so much!
@anmolkumar01
@anmolkumar01 Жыл бұрын
at 55:44 , i think we don't need to add extra case when there is only one element in list one instead what we can do is - we can simply write that condition of if(next1== NULL and curr2 != NULL){ curr1 -> next = curr2; } it will take care of case at 55:44 as well as previous case when first list finish and second list still has some element and please feel free to to correct me if i am wrong ,
@Josuke217
@Josuke217 6 ай бұрын
My approach: SC: O(n) , TC: O(n) For 0,1,2. class Solution { public: ListNode* sortList(ListNode* head) { vector res; ListNode* temp = head; while(temp != nullptr) { res.push_back(temp->val); // Store value of current node temp = temp->next; // Move to next node } sort(res.begin(),res.end()); // Sort the vector // Now convert the vector into the sorted linked list int index=0; temp = head; while(temp != nullptr) { temp->val = res[index++]; temp = temp->next; } return head; } }
@Roshanhoro123
@Roshanhoro123 2 жыл бұрын
thanks bhaiya for bringing all such good questions in this course and hats off to your efforts...aap itne busy hoke bhi regular videos daal rhe ho isse motivation milta hai ki chahe kitne bhi busy rhe humlog cllg exams me tb bhi hum pdhai krre... Thanks bhaiya...Keep smiling bhaiya bht suit krta hai aaapar..
@devanshusahoo
@devanshusahoo 2 жыл бұрын
Thank you so much for your lovely videos, you really make understanding the concepts a cakewalk! Glad to be your student.
@divyareddy7622
@divyareddy7622 2 жыл бұрын
why cant zero and two 's list be empty here? he only took the case when 1's list is empty
@suranjandhara7535
@suranjandhara7535 2 жыл бұрын
Wow 😳😳😳😳😳 nya video aa gya..... Maza aa gya .... Abhi hi dekh lunga....🥰🥰🥰🥰🥰🥰🥰❤️❤️❤️❤️❤️❤️❤️❤️❤️🌷🌷🌷🌷🌷🌷🌷🌷🌷 Thanku bhaiya .... ❤️❤️❤️❤️
@mittalji919
@mittalji919 3 ай бұрын
i used below merging algo and it is also working without any if condition nodeZTail->next = nodeO->next; delete(nodeO); nodeOTail->next = nodeT->next; delete(nodeT); head = nodeZ->next; delete(nodeZ); return head;
@115GAJBHIYESHREYA
@115GAJBHIYESHREYA 2 ай бұрын
Thank you for providing an amazing series.
@StayAware9
@StayAware9 2 жыл бұрын
Itna cylister clear hogaya question and approach Oye hoye hoye Jug Jug Jio bhai!!!
@anmolkumar01
@anmolkumar01 Жыл бұрын
my approach for 1st question was that i just sorted it in two go without using extra space and in O(n) firstly : sort all the ones , if one present then remove it and link it to the head of list and update the head secondly : sort all the zeros , if 0 is present then remove it and link it to the head of list and update the head my code : void sort(Node* &head , int val){ Node* temp = head; while(temp->next != NULL){ if(temp->next->data == val){ Node* x = temp->next; temp->next = x->next; x->next = head ; head = x; } else{ temp = temp->next; } } } Node* sortList(Node *head){ if(head == NULL or head->next == NULL) return head; sort(head , 1); sort(head , 0); return head; } if there is any suggestion or correction then please feel free to correct me and above code is also accepted by the codestudio
@vmstudy9965
@vmstudy9965 10 ай бұрын
Mjaa aa gya bhiya aaj to🎉 Finally I solved this problem myself. After watching this video
@chinmaykhemariya3816
@chinmaykhemariya3816 3 ай бұрын
for 2nd question Node* sortTwoLists(Node* first, Node* second) { Node* a=first; Node* b=second; Node*k=new Node(-1);Node*tail=k; while(a!=NULL&&b!=NULL){ if(a->datadata){ tail->next=a;tail=a; a=a->next; } else{ tail->next=b; tail=b; b=b->next; } } if(a!=NULL){ tail->next=a; } else if(b!=NULL){ tail->next=b; }k=k->next; return k; }
@ujjwalverma_
@ujjwalverma_ 2 жыл бұрын
Bhaiya boht mja aa rha is course me. Paid me bhi aisa mja ni aata. Discord pe discussion and all. Great 🔥🔥🔥
@kinmeensura4283
@kinmeensura4283 2 жыл бұрын
very good explanation . now i am understanding everything . you are a very good teacher and motivator also, please keep it up 😅😅
@laksheybanga8106
@laksheybanga8106 2 жыл бұрын
Bhaiya I m your biggest fan! bas jldi se phase 2 khtm krdo bhaiya!
@DipsOfficial802
@DipsOfficial802 Жыл бұрын
smaj gya bhaiya clear hai concept 🔥🔥🔥🔥
@RohitRana-tz2lr
@RohitRana-tz2lr 2 жыл бұрын
Thank you so much bhaiya for training our mind in solving a different variety of questions... hats off to you bhaiya...keep it up
@anuragpatel7787
@anuragpatel7787 10 ай бұрын
hnji this is anurag patel Lec 49 completed successfully ✅
@avibirla9863
@avibirla9863 2 жыл бұрын
Maza aa gaya bhaiya kya question tha merge wala 👍👍Or last ka edge case 👍♥️
@shubhammathur792
@shubhammathur792 Жыл бұрын
amazing lecture bhaiya i think one of the best so far cleared every concept ;
@hyphengamerandtech3064
@hyphengamerandtech3064 9 ай бұрын
thank you bhaiya , placement ke baad aapko party meri taraf se .
@udaypratapsingh8923
@udaypratapsingh8923 2 жыл бұрын
bhaiyaa ye hashing or heap bhi cover krva dena ... jab bhi ye sunta hui dar sa lagta hai 😅😅😅
@sounaksaha1455
@sounaksaha1455 2 жыл бұрын
Present Bhaiya, consistency OP, videos OP, Reach OP.
@trishalmandrik1295
@trishalmandrik1295 2 жыл бұрын
Hey! what does this OP mean?
@060_jiteshtripathi6
@060_jiteshtripathi6 Жыл бұрын
bhaiya maza hi aagya, kya mast samjhate ho
@RajDas-uq6sh
@RajDas-uq6sh Жыл бұрын
Sir in question 2 : If first -> next == NULL then answer will note come.. Please add another condition- if(first -> next == NULL) { first -> next = second; return first; }
@tanbirsarkar2640
@tanbirsarkar2640 Жыл бұрын
sabse maza to linked list mai arha hai,,mast hai bahut,,basss pyar hojata hai
@kanikagupta2806
@kanikagupta2806 2 жыл бұрын
concept++; understanding +++++++++; thankyou so much babbar bhaiya maza hi aagya..
@divyareddy7622
@divyareddy7622 2 жыл бұрын
why cant zero and two 's list be empty here? he only took the case when 1's list is empty
@kanikagupta2806
@kanikagupta2806 Жыл бұрын
@@divyareddy7622 beacuse 1's list is connecting 0's and 2's list. If 1's list is empty then approach discussed without if condition won't work. Hope it helps.
@Pawankumar-i8c
@Pawankumar-i8c 4 ай бұрын
thank you so much bhiaya for these precious lecture
@theOmKumar
@theOmKumar 2 жыл бұрын
Explanation + Minor adjustment to improve q1 while addressing memory leak! // // merge 3 sublist (assuming one's list is not empty) zeroTail -> next = oneHead -> next; oneTail -> next = twoHead -> next; twoTail -> next = NULL; return zeroHead -> next; //merge 3 sublist (Note: if 1st list is empty, then we can't connect zero list with two list using previous code) if (oneHead -> next != NULL) //one's list is not empty, so we'll connect 0 list with one { zeroTail -> next = oneHead -> next; oneTail -> next = twoHead -> next; } else zeroTail -> next = twoHead -> next; //one's list is empty, so we'll connect 0 list with 2s directly; twoTail -> next = NULL; //this will end the LL. return zeroHead -> next; // //to prevent memory leak, due to allocation of dummy node so we need to delete it. // Node* ans = zeroHead -> next; // delete(zeroHead); // delete(oneHead); // delete(twoHead); // return ans; }
@lakshsinghania
@lakshsinghania Жыл бұрын
exactly! kudos
@arpitghura
@arpitghura Жыл бұрын
this is what I am supposing as the oneHead does not have any one node, so if we put it outside it will create an additional LL which is of no use. So, we can put the line no. 60 inside the if condition to prevent the creation of additional LL.
@tanishsinghal1879
@tanishsinghal1879 11 ай бұрын
shi hai bhai agr tu comment m nhi likhta ye sb to mai ye sochta syad m hi glt hun
@adityachauhan5913
@adityachauhan5913 2 жыл бұрын
@codeHelp bhaiya ek dummy node le kr compare aur direct connect karte chale jaaye last me dummy ka nxt return kar dnge
@KaushikSharma-c3q
@KaushikSharma-c3q Жыл бұрын
Awesome explanation.
@kunalmodiart
@kunalmodiart 2 жыл бұрын
more easiest way to code Q2 would be to use 2 pointers pointer pointing smallest element gets added at the end of ansLL //============================================= Node* solve(Node* first, Node* second){ Node* ans=new Node(-1); Node* anstail=ans; Node* fhead=first; Node* shead=second; while(fhead!=NULL&&shead!=NULL){ if(fhead->datadata){ anstail->next=fhead; anstail=anstail->next; fhead=fhead->next; }else{ anstail->next=shead; anstail=anstail->next; shead=shead->next; } } while(shead!=NULL){ anstail->next=shead; anstail=anstail->next; shead=shead->next; } while(fhead!=NULL){ anstail->next=fhead; anstail=anstail->next; fhead=fhead->next; } anstail->next=NULL; return ans->next; } Node* sortTwoLists(Node* first, Node* second) { if(first==NULL){ return second; } if(second==NULL){ return first; } return solve(first,second); } //=============================================
@adityaraj-zm7zk
@adityaraj-zm7zk 2 жыл бұрын
bhai it is very good question and you really very good explained , fanstically you are very good teacher
@sachitdhamija1884
@sachitdhamija1884 2 жыл бұрын
bhaiya acha tha merge 2 sort L.L samjaha but sort 0,1,2 thoda problem hua but 2 baar aur dekho ga toh samjho ga lage raho
@vaibhavraj2847
@vaibhavraj2847 Жыл бұрын
bhaiya aapne jo array me merge and sort wala concept se padhaya tha ussejyada easy se ho gaya!! #include #include using namespace std; class node { public: int data; node *next; node(int data) { this->data = data; this->next = NULL; } ~node() { int value = this->data; if (this->next != NULL) { next = NULL; } delete next; cout next = curr2; tail = curr2; curr2 = curr2->next; } } while (curr1 != NULL) { tail->next = curr1; tail = curr1; curr1 = curr1->next; } while (curr2 != NULL) { tail->next = curr2; tail = curr2; curr2 = curr2->next; } head = head->next; return head; } int main() { node *head1 = NULL, *head2 = NULL; node *tail1 = NULL, *tail2 = NULL; insert(1, head1, tail1); insert(3, head1, tail1); insert(5, head1, tail1); insert(8, head1, tail1); insert(2, head2, tail2); insert(4, head2, tail2); insert(5, head2, tail2); insert(8, head2, tail2); insert(10, head2, tail2); print(head1); print(head2); node *ans = merge_two(head1, head2); print(ans); }
@verma_jay
@verma_jay Жыл бұрын
Bhaiya bhot acha pdhate ho aap
@aishavkhandelwal8271
@aishavkhandelwal8271 2 жыл бұрын
Mst ques tha dimag khul diya pura !! thx
@alokranjan3185
@alokranjan3185 2 жыл бұрын
totatly different explanation bhaiya, thanks
@himanshugaur6790
@himanshugaur6790 Ай бұрын
Another Approach to merge two sorted linked list Node* sortTwoLists(Node* first, Node* second) { Node* dummynode = new Node(-1); Node* temp = dummynode; while(first!=NULL && second!=NULL){ if(first->datadata){ temp->next = first; first = first->next; } else{ temp->next = second; second = second->next; } temp = temp->next; } if(first!=NULL){ temp->next = first; first = first->next; } else if(second!=NULL){ temp->next = second; second = second->next; } return dummynode->next; }
@presidentg6048
@presidentg6048 8 ай бұрын
Bhaiya -> using recursion ListNode* mergeTwoLists(ListNode* & list1, ListNode* & list2) { // base case if( list1 == nullptr ) return list2 ; else if ( list2 == nullptr ) return list1 ; // return the smallest node if( list1->val < list2->val ) { list1->next = mergeTwoLists( list1->next , list2 ) ; return list1 ; } else { list2->next = mergeTwoLists( list2->next , list1 ) ; return list2 ; } }
@avishkarpatil5871
@avishkarpatil5871 Жыл бұрын
Merge 2 Sorted Linked Lists - Approach 2 -> 99 % Faster void insertNode(Node* curr, Node* &tail){ tail->next = curr; tail = curr; } Node* mergeArray(Node* first, Node *second){ Node* addHead = new Node(-1); Node* addTail = addHead; Node* ptr1 = first; Node* ctr2 = second; while(ptr1 != NULL && ctr2 != NULL){ if(ptr1->data < ctr2->data){ insertNode(ptr1,addTail); ptr1 = ptr1->next; } else{ insertNode(ctr2,addTail); ctr2 = ctr2->next; } } while(ptr1 != NULL){ insertNode(ptr1,addTail); ptr1 = ptr1->next; } while(ctr2 != NULL){ insertNode(ctr2,addTail); ctr2 = ctr2->next; } Node* head = addHead->next; return addHead->next; }
@rachit_joshi
@rachit_joshi 8 ай бұрын
Thank You So Much BHRATA SHREE !!!!!
@-akashkumarsingh
@-akashkumarsingh 2 жыл бұрын
Mere dekhne ki consistency se jyadaa toh video aane ki hai..
@itz_arman_official__
@itz_arman_official__ 2 жыл бұрын
Thanks for your amazing content and your consistency is awesome bhaiya.
@anuragpandey8165
@anuragpandey8165 2 жыл бұрын
37:10 Just call sortTwoList(second, first) thats it.
@justarandomguy6106
@justarandomguy6106 2 жыл бұрын
How's that possible
@AWAISKHALID-ze5cw
@AWAISKHALID-ze5cw Жыл бұрын
the second approach could as to create a new head and make the new links after checking each data for the current pointer. it would create a new organised link with the previous one
@Hit-xe5uh
@Hit-xe5uh 11 ай бұрын
Can't we simply apply selection sort in the first question?
@lalitbisht8381
@lalitbisht8381 Жыл бұрын
merge wala question krke maza aa gya!!!!!!!!!!
@RitikSingh-oh3sj
@RitikSingh-oh3sj 2 жыл бұрын
merge walai second question mai maga aa gaya bhaiya
@B-NikhilRichhariya
@B-NikhilRichhariya Жыл бұрын
aap mehnat krte ho na wo dekh ke aur mehnat krne ka mn krta hai
@arvindjindal1913
@arvindjindal1913 Жыл бұрын
ham second question mai ek nai list ans banakr aur usme koi value like -1 dekr phir jo first aur second mai jo chota hai usko ans list se link nhi karva sakte aur return karvate waqt ans ke next se return bhi toh karva skte h
@abhishekhsinha1551
@abhishekhsinha1551 10 ай бұрын
glad for your kind help moye moye !!! love from IITG
@prashantbirajdar9271
@prashantbirajdar9271 2 жыл бұрын
ha bhaiyaa smja aya ache se ekdum bdiya❣😾❤
@samsmith3961
@samsmith3961 2 жыл бұрын
concept finally samajh aa gya
@garimasharma276
@garimasharma276 Жыл бұрын
NEVER have I ever got such a crush on some one!! your way of teaching is quite captivating.
@princekatare5399
@princekatare5399 2 жыл бұрын
Bhaiya at 21:20....... instead of writing the if conditions like this..... if(oneHead->next != NULL) { zeroTail -> next = oneHead->next; } else { zeroTail -> next = twoHead->next; } oneTail->next = twoHead->next; We can write the code........ in the following order oneTail->next = twoHead->next; zeroTail -> next = oneHead->next; (we first link the twoHead to oneTail and then oneHead to zeroTail......) anyone please correct me if i am wrong...... And also thank you for the playlist bhaiya the DSA series is awsome and really helpful....
@muneebjaved3940
@muneebjaved3940 2 жыл бұрын
Thank you so much bhayia Concept ++++++; Explanation ++++++++;
@anuptewary3016
@anuptewary3016 2 жыл бұрын
Present bhaiya with lot's of Josh
@riyadhossain1706
@riyadhossain1706 Жыл бұрын
Became a fan of your learning style...........
@StayAware9
@StayAware9 2 жыл бұрын
add a thanks button we want to pay you for your good work! ❤❤❤❤❤❤❤
@RohitSingh-hc8yi
@RohitSingh-hc8yi Жыл бұрын
2nd Problem was awesome!
@RohitSingh-hc8yi
@RohitSingh-hc8yi Жыл бұрын
Thankyou for such a quality content
@rishikbisen4268
@rishikbisen4268 2 жыл бұрын
it also one approach to solve problem 💥💥💥💥💥💥 Node* sortedMerge(Node* head1, Node* head2) { if (head1==NULL) return head2; if (head2==NULL) return head1; if (head1->datadata) { head1->next=sortedMerge(head1->next, head2); return head1; }else { head2->next=sortedMerge(head1,head2->next); return head2; } }
@salmankhader1258
@salmankhader1258 Жыл бұрын
small idea , if we put the condition which babbar wrote just before ending of while loop in the starting of the loop then it will handle the code for edge cases like if we have only one Node in our first list hence no need to write the seperate if condition for that edge case.
@shishirkj
@shishirkj Жыл бұрын
can u explain this more plz
@sarthakmoriya541
@sarthakmoriya541 2 жыл бұрын
what is Node can anyone please tell???
@ritikamehta9791
@ritikamehta9791 2 жыл бұрын
Great work sir!! mza aa rha hai ab pdhne me💯
@kundanmali2405
@kundanmali2405 Жыл бұрын
thank you for providing such great content.
@Engineering_Unlocked
@Engineering_Unlocked 4 ай бұрын
thnx bhaiya :) completed on 8/7/24
@theOmKumar
@theOmKumar 2 жыл бұрын
Simpler Approach for Q2. , we can also do this without dummy node by putting head at right place first , and then simply traversing and joining smaller val data. ListNode* mergeTwoLists(ListNode* list1, ListNode* list2) { if (!list1) return list2; if (!list2) return list1; ListNode *ans = new ListNode(-1); ListNode *temp = ans; while (list1 && list2) { if (list1->val < list2->val) { temp -> next = list1; temp = list1; list1 = list1 -> next; } else { temp -> next = list2; temp = list2; list2 = list2 -> next; } } while (list1) { temp -> next = list1; temp = list1; list1 = list1 -> next; } while (list2) { temp -> next = list2; temp = list2; list2 = list2 -> next; } return ans -> next; }
@kunalmodiart
@kunalmodiart 2 жыл бұрын
i watched the solution given in the video then went on to code the Q by myself with my approach .. then i came in comments to add my code and i found your code which is literally similar to mine 😂 what a coincidence
@antrikshgupta1964
@antrikshgupta1964 Жыл бұрын
void sort(Node* &tail, Node* &head){ tail->next = head; head = head->next; tail = tail->next; } //Function to merge two sorted linked list. Node* sortedMerge(Node* head1, Node* head2) { Node* head = new Node(-1); Node* tail = head; while(head1!=NULL and head2!=NULL){ if(head1->data data){ sort(tail,head1); } else{ sort(tail,head2); } } while(head1!=NULL){ sort(tail,head1); } while(head2!=NULL){ sort(tail,head2); } return head->next; }
@priyanshujain862
@priyanshujain862 2 жыл бұрын
Amazing bhaiya 🤩🤩
@pahaljain9209
@pahaljain9209 Жыл бұрын
Hat's Of bhaiya
@neerajgarg9096
@neerajgarg9096 2 жыл бұрын
EAGERLY WAITING FOR THIS LECTURE LOVE U BABBAR BHAIYA❤❤
@ch0c0_1
@ch0c0_1 Жыл бұрын
mza aagya bhai . Nice explanation
@saurabhmalviya100
@saurabhmalviya100 2 жыл бұрын
Kya baat hai mazaa aa gaya .josh is high and it should be High 😂😂😂
@saswatighosh3162
@saswatighosh3162 2 жыл бұрын
It was lit 🔥🔥🔥🔥🔥🔥🔥
@HemantNavlani
@HemantNavlani Жыл бұрын
In 1st question if we have made three sub lists of 0 1 and 2 in approach 2 would it not account for extra O(N) space ??
@ritik8879
@ritik8879 2 жыл бұрын
attendance marked . bhaiya if possible video thoda jaldi jaldi daalo plz . my career depends on you
@sundrmm0350
@sundrmm0350 11 ай бұрын
Bhiyaaaa!!! Uh beauty🙇🏻‍♂️
@divyanshupal1102
@divyanshupal1102 Жыл бұрын
if 0 empty or 2 empy then ?? there should be conditon for that also na???
@Dharmikmonk
@Dharmikmonk 2 жыл бұрын
Bohot aachi vdo hai bhaiya
@ayushp4471
@ayushp4471 2 жыл бұрын
BEST explaination as always 🔥🙌
@jatingarg1897
@jatingarg1897 2 жыл бұрын
Maza Aaayaa bhai karke !
@sushantgupta4757
@sushantgupta4757 2 жыл бұрын
you are the best bhaiya
@aadityagupta3720
@aadityagupta3720 Жыл бұрын
in first question we can use dutch national flag algo also
@anuragpandey8165
@anuragpandey8165 2 жыл бұрын
24:52 insertAtTail function kaha defined hai??
@shripandey4120
@shripandey4120 2 жыл бұрын
Bhaiya, 27:05 pr space complexity o(1) kse hogi, humne jo alag se three linked list bnayi hai uska space ?
@muhammadasimsaeed2568
@muhammadasimsaeed2568 9 ай бұрын
Can someone explain to me why at 22:31 in line 60 we are connecting one->tail to twoHead->next as we have already connected zeroTail to 1's List in if condition and zeroTail to 2's list in else condition, Thanks in advance
Lecture 50: Check Palindrome in Linked List || C++ Placement Course
22:38
CodeHelp - by Babbar
Рет қаралды 150 М.
Lecture 53: Merge Sort in Linked List [ Theory + Implementation ]
27:49
CodeHelp - by Babbar
Рет қаралды 179 М.
Муж внезапно вернулся домой @Oscar_elteacher
00:43
История одного вокалиста
Рет қаралды 6 МЛН
When u fight over the armrest
00:41
Adam W
Рет қаралды 31 МЛН
The Ultimate Sausage Prank! Watch Their Reactions 😂🌭 #Unexpected
00:17
La La Life Shorts
Рет қаралды 8 МЛН
Twin Telepathy Challenge!
00:23
Stokes Twins
Рет қаралды 96 МЛН
L23. Merge two sorted Linked Lists
18:55
take U forward
Рет қаралды 71 М.
This Algorithm is 1,606,240% FASTER
13:31
ThePrimeagen
Рет қаралды 852 М.
ASHNEER GROVER GOT ROASTED BY SALMAN KHAN!
13:08
Thugesh Unfiltered
Рет қаралды 1 МЛН
Lecture 51: Add 2 Numbers represented by Linked Lists || C++ Placement Course
26:24
I Solved 1583 Leetcode Questions  Here's What I Learned
20:37
ThePrimeTime
Рет қаралды 736 М.
Lecture 48: Remove Duplicates from a Sorted/UnSorted Linked List
27:25
CodeHelp - by Babbar
Рет қаралды 196 М.
Beginners Should Think Differently When Writing Golang
11:35
Anthony GG
Рет қаралды 123 М.
DSA & ₹1.2 Crore Per Annum Jobs - The Truth? (No Offence)
12:22
CodeWithHarry
Рет қаралды 712 М.
Муж внезапно вернулся домой @Oscar_elteacher
00:43
История одного вокалиста
Рет қаралды 6 МЛН