Lecture 45: Linked List Questions: Reverse LL and find Middle of LL

  Рет қаралды 407,365

CodeHelp - by Babbar

CodeHelp - by Babbar

Күн бұрын

Пікірлер: 416
@lakshyamittal1329
@lakshyamittal1329 Жыл бұрын
For those who can't understood the Approach 3 code of Reversing Linked-List (Recursively), Let's go through an example with a diagram to help illustrate the process. Suppose we have the following singly-linked list: 1 -> 2 -> 3 -> 4 -> 5 -> NULL To reverse this list, we can use the given code. 1. Initially, the `reverseList` function is called with the head of the list (`1`). 2. Inside the `reverse1` function, the base case is not met because the head is not `NULL` and it has a `next` pointer. 3. The `reverse1` function is recursively called with the next node (`2`) as the argument. 4. The process continues until the base case is met when we reach the last node (`5`) in the original list. 5. At this point, the recursion starts to unwind. Let's see the state of the list at each step: Step 1: chotaHead = 5 (the last node) Original list: 1 -> 2 -> 3 -> 4 -> 5 -> NULL Step 2: chotaHead = 5 Current node (head) = 4 Reverse the link between 4 and 5: 4 next = NULL to remove the link to the next node: 4 -> NULL Return chotaHead (5) Step 3: chotaHead = 5 Current node (head) = 3 Reverse the link between 3 and 4: 3 next = NULL: 3 -> NULL Return chotaHead (5) Step 4: chotaHead = 5 Current node (head) = 2 Reverse the link between 2 and 3: 2 next = NULL: 2 -> NULL Return chotaHead (5) Step 5: chotaHead = 5 Current node (head) = 1 Reverse the link between 1 and 2: 1 next = NULL: 1 -> NULL Return chotaHead (5) 6. The `reverseList` function now returns the new head of the reversed list, which is `chotaHead` (5). 7. The reversed list is: 5 -> 4 -> 3 -> 2 -> 1 -> NULL I hope this helped... Happy Coding✌
@darshnitwarangal
@darshnitwarangal Жыл бұрын
thnk u so much bhaiya gr8 explanation
@rajahindustani5771
@rajahindustani5771 Жыл бұрын
Awesome bro
@amanasrani6405
@amanasrani6405 Жыл бұрын
thanks you so much , i can't undersastand this method through the vdo
@njcoder2641
@njcoder2641 Жыл бұрын
hats off bhaiya .. You clear my doubts in only two steps :)
@thecap7249
@thecap7249 11 ай бұрын
Bro one doubt how are we going to generate this approach ?
@virendrakeshri6072
@virendrakeshri6072 2 жыл бұрын
You are working two hard i am first year student in chitkara university and following all videos thanks bhaiya
@BornHubisLive
@BornHubisLive 2 жыл бұрын
Great dude keep it up.... I'am also.. In Chitkara 😂😂
@thakurtech0167
@thakurtech0167 Жыл бұрын
Cgcian's are also there bro
@priyavratatiwari7788
@priyavratatiwari7788 Жыл бұрын
Bhai waise one hard kaise work karte hai? 😂
@sahilsingh1649
@sahilsingh1649 Жыл бұрын
@@priyavratatiwari7788 two hard se addhe time me
@vikaskumarsingh6807
@vikaskumarsingh6807 10 ай бұрын
Kitna pdh lia DSA
@yashahuja1550
@yashahuja1550 10 ай бұрын
void reverse(Node *head,Node *tail,int n) { Node *i=head; Node *j=tail; for(int k=0;kdata,j->data); i=i->next; j=j->previous; } swap(head,tail); return; } my approach thnk u bhaiya for making me this much capable
@SurajKumar-by9fh
@SurajKumar-by9fh 7 ай бұрын
Good one brother....
@SurajKumar-by9fh
@SurajKumar-by9fh 7 ай бұрын
Atlast you don't need to swap head and tail bro
@mamonigogoi3870
@mamonigogoi3870 2 жыл бұрын
Following your series till this lecture, I got an internship in a Noida based company. Thank you so much bhaiya!! It was all because of you.. Please keep up the good work.. Can't thank you enough 🙏🙏🙏🙏
@icecoldnobody3447
@icecoldnobody3447 2 жыл бұрын
wow bhai....kisme aaya..?nd what is the pay structure..+ are u still a student? which yr?
@AkshayGoel-of8ic
@AkshayGoel-of8ic Жыл бұрын
bhai please mujhe bhi help kar do, internship lagane mai please
@shalinijha7359
@shalinijha7359 2 жыл бұрын
bhaiya shi me confidence aa jata h appke solution dekh k .. you motivate us a lot and aap mere inspiration ho
@sahilbheke4083
@sahilbheke4083 2 жыл бұрын
at 42:13 we can simply assign middle = (n/2)+1 and cnt=1;
@anmol3
@anmol3 Жыл бұрын
Right
@rajgopalsahu
@rajgopalsahu Жыл бұрын
for the 2nd problem(finding the middle) you can simply write //APPROACH 2 Node *findMiddle(Node *head){ //if the list has no nodes or a single node if(head==NULL || head->next==NULL){ return head; } Node *slow=head; Node *fast=head; while(fast!=NULL && fast->next!=NULL){ slow=slow->next; fast=fast->next->next; } return slow; }
@yashahuja1550
@yashahuja1550 10 ай бұрын
right bro
@vitaminprotein2217
@vitaminprotein2217 2 жыл бұрын
Middle of a linked list ez two pointer sol (two pointer approach) ListNode *slow = head, *fast = head; while(fast && fast -> next){ slow = slow -> next; fast = fast -> next -> next; } return slow
@POTNURURAHULADITHYA
@POTNURURAHULADITHYA 5 ай бұрын
@vitaminprotein2217 in approach 1 why didn't he use a reference variable in the case of head pointer .
@viveksinghgulia8739
@viveksinghgulia8739 Жыл бұрын
My code for the finding the middle of the linked list(I think it is cleaner) Node *findMiddle(Node *head) { Node *fast = head; Node *slow = head; while(fast && fast->next) { fast = fast ->next ->next; slow = slow->next; } return slow; }
@anmol3
@anmol3 Жыл бұрын
Your code is faster
@torus151
@torus151 2 жыл бұрын
apne last video ma concept aise samjaya tha ki questions ka approch already dimag ma aagaya tha.....thanks alot for such explination
@Abhishek-ji6qj
@Abhishek-ji6qj 5 ай бұрын
Bhai Zabardast Boss Esi explaination ho to DSA bahut simple lagta hai. Other channels pe bhi search kia lekin crystal clear yha aa ke hi hua.
@akashprajapati2393
@akashprajapati2393 2 жыл бұрын
Sir you are best teacher of dsa on youtube in my life . Sir charan sparse. From ncr.
@venugopalaniyengar3550
@venugopalaniyengar3550 2 жыл бұрын
According to my experience till now... I would rather work in a challenging place where I have to think a lot and make mistakes and write code than do runt work like creating reports with already made software... Am loving the series bhai... following it religiously... I will give you a nice party when I get placed with > 40 lpa... Results await!! Love you bhai for this awesome step by step but slightly challenging journey ever!!!
@yashsawalkar646
@yashsawalkar646 Жыл бұрын
lagi kya plaement ?
@top_10_2.O
@top_10_2.O Жыл бұрын
lgii??
@abhishek6575
@abhishek6575 Жыл бұрын
lagi kya
@AkshayGoel-of8ic
@AkshayGoel-of8ic Жыл бұрын
please tell
@priyamprakash1209
@priyamprakash1209 11 ай бұрын
lgi kya
@seniordevtuts
@seniordevtuts 2 жыл бұрын
sir if you need any help or support related to anything just say only once we are here for you. you are a best tutor
@akashbiswas8639
@akashbiswas8639 2 жыл бұрын
internship dedo vro
@AkshayGoel-of8ic
@AkshayGoel-of8ic Жыл бұрын
@@akashbiswas8639 aapki lag gayi? ab toh 1 saal ho gya, please meri help kar do
@tanyakansal465
@tanyakansal465 2 жыл бұрын
I think separately handling the cases for linked list length = 0,1,2 are not required. We can directly write the logic.
@HARRY-xz1hf
@HARRY-xz1hf Жыл бұрын
Thanks Babbar bhai.. Your videos are really easy to understand and provoke new approaches in our minds. Thanks a lot.
@anushkayachit
@anushkayachit 2 жыл бұрын
attendance marked sir!!! really enjoying the course🖤🖤
@satvikshukla596
@satvikshukla596 2 жыл бұрын
I wish I could work as hard as you 😂 Thank you for all the efforts 🙏
@shubhamrathod6634
@shubhamrathod6634 2 жыл бұрын
u will
@raygod1441
@raygod1441 Жыл бұрын
@@shubhamrathod6634 hopefully I'll too
@AnkitKumar-js9rx
@AnkitKumar-js9rx Жыл бұрын
My code for homework (for reference I used the 2nd recursion approach for the reverse singly linked list from the video and modified it to update previous pointer of the node as well): Node* reverseDoublyLinkedList(Node* head) { if(head == NULL || head -> next == NULL) { return head; } Node* newHead = reverseDoublyLinkedList(head -> next); head -> prev = head -> next; head -> next -> next = head; head -> next = NULL; return newHead; } It works but if you could confirm that I'm not wrong here, actually didn't put much time into it so I'm doubtful about it.
@vineeta136
@vineeta136 Жыл бұрын
Node* reverse_LL(Node* head){ if(head == NULL || head->next == NULL){ return head; } Node* temp = reverse_LL(head->next); head->next->prev=head->next->next; head->next->next=head; head->prev=head->next; head->next=NULL; return temp; }
@sadaf_r
@sadaf_r 2 жыл бұрын
H/w solution Node* reverseDoublyLL(Node* head){ if(head==NULL || head->next==NULL) return head; Node* temp=head; Node* store=NULL; While(temp!=NULL){ //Swapping the addresses store=temp->prev; temp->prev=temp->next; temp->next=store; temp=temp->prev;} return store->prev; }
@muneebjaved3940
@muneebjaved3940 2 жыл бұрын
Really outstanding contents bhayia. Understand All approaches crystal Clear just because of you.
@unboxtheuniverse5336
@unboxtheuniverse5336 2 жыл бұрын
Abhi hi bhaiya just LL ki 2 ghante ki video complete kri he 😃 Now .... It's Tea time 🥱😂 Abb ye raat me dekhuga 😃😃 2 ghante ke lecture dekhne par bhi Borr nhi hota just bcz of you . #BeliveInBabbar Your Explanation is Always OP 🔥
@akash.vishwakarma
@akash.vishwakarma 8 ай бұрын
Orr bhai?? 2 saal ho gye... ky ky seekha?
@tayyabsami258
@tayyabsami258 Жыл бұрын
The word Love in your name holds a specific place in my heart 🥺
@Rohit-vd3mj
@Rohit-vd3mj 2 жыл бұрын
H.W- reverse doubly LL : Node* reverse_LL(Node* head){ if(head == NULL || head->next == NULL){ return head; } Node* temp = reverse_LL(head->next); head->next->prev=head->next->next; head->next->next=head; head->prev=head->next; head->next=NULL; return temp; }
@ritikamehta9791
@ritikamehta9791 2 жыл бұрын
Just finished the previous one and was waiting for this finally its here !😀🔥
@divyanshsen6573
@divyanshsen6573 2 жыл бұрын
This channel is sheer brilliance and exceptional epitome of the fantabulous knowledge and learnings. KUDOS to you LOVE BABBAR bhiya 🙌
@keshavarya7918
@keshavarya7918 2 жыл бұрын
Bhai kripya iska Hindi anuvaad kar dijiye😅
@divyanshsen6573
@divyanshsen6573 2 жыл бұрын
@@keshavarya7918 zyaada ho gya kya😂
@divyanshsen6573
@divyanshsen6573 2 жыл бұрын
@@keshavarya7918 bass sir ko , bhawnao mai aake dil se shukriya kaha hai.
@keshavarya7918
@keshavarya7918 2 жыл бұрын
Pata hai bhai 😂😂 Maze le raha tha
@AkshayGoel-of8ic
@AkshayGoel-of8ic Жыл бұрын
@@divyanshsen6573bhaiya aapki job lag gayi? Please meri thoda internship dhoodne mai help kar dijiye
@033_rajatsingh2
@033_rajatsingh2 Жыл бұрын
The way you taught the approach 2 of 2nd question was 🔥🔥
@RAZERRUG
@RAZERRUG 2 жыл бұрын
attendance marked sir jiii !!! really enjoying the course🖤🖤
@kailashdaata8610
@kailashdaata8610 2 жыл бұрын
more optimized code for middle of linked list : public static Node findMiddle(Node head) { Node slow = head; Node fast = head; while(fast != null && fast.next != null) { slow = slow.next; fast = fast.next.next; } return slow; }
@priyanshu_-_
@priyanshu_-_ 2 жыл бұрын
In the even length LL it will not print the correct O/P....e.g. in 1->2->3->4->5->6....it'll print 3 but correct ans should be 4 !!
@sparsh2120
@sparsh2120 2 жыл бұрын
@@priyanshu_-_ Intialy: slow=1; fast=1; 1st jump: slow=2; fast=3; 2nd jump: slow=3; fast=5; Still fast->next!=null; 3rd jump: slow=4; fast=null; Return slow..... M I right or wrong????
@vats4684
@vats4684 2 жыл бұрын
@@sparsh2120 absolutely right. I think priyanshu interpreted it wrong. The code works
@RohitRana-tz2lr
@RohitRana-tz2lr 2 жыл бұрын
Thanks bhaiya for explaining linkedin question in so much depth .... attendance marked bhaiya... mja hi aa gya
@prakashnandan7337
@prakashnandan7337 Жыл бұрын
REVERSES DOUBLY LINKED LIST USING RECURSION Node* reverse(Node* &head){ //base case if(head== NULL || head->next==NULL){ return head; } Node* ChotaHead= reverse(head->next); head->next->next = head; head->prev = head->next; head->next=NULL; return ChotaHead; }
@jayantbaid
@jayantbaid 2 жыл бұрын
RECURSIVE CODE FOR DOUBLY LINKED LIST node* reverseLL(node* head){ if(head==NULL || head->next==NULL) return head; node* chota=reverseLL(head->next); head->next->next=head; head->prev=head->next; head->next=NULL; return chota; }
@adityauniyal8632
@adityauniyal8632 2 жыл бұрын
Head - next - prev will not update i think for last node
@nischayagrawalVlogs
@nischayagrawalVlogs Жыл бұрын
Approach 3 of Reversing linkedlist is the proper "recursive" way otherwise the 2nd method was just like the iterative way. If you could understand the 3rd approach then you have a bright future in trees and advance topics
@sachitdhamija1884
@sachitdhamija1884 2 жыл бұрын
bhaiya aise hi bhaut saare approch aur question baate raho
@suranjandhara7535
@suranjandhara7535 2 жыл бұрын
Aa gya hu bhaiya.....Abhi college ka online class chal raha hai... Iska complete hone ke bad hi aap ka ye video dekhunga.... Mai to subha se hi aap ka lecture dekh raha hu....mast hai.... I am in OOPS 2... Now..... I will complete it then I will watch this... Thank you bhaiya for providing such amazing content 😘😘😘😘😘😘😘❤️❤️❤️❤️❤️❤️❤️❤️❤️❤️❤️❤️❤️❤️
@NiteshKumar-qp7oy
@NiteshKumar-qp7oy 2 жыл бұрын
Thanks bhiya 🤗 mai bahot sare videos dekha hun put apke name sehi lgta ki video achi hogi 😌
@jagannathnayak12
@jagannathnayak12 Жыл бұрын
Recursive approach:- Node *recurmid(Node* &head,int len){ Node *temp=head; if(len==1){ return temp; } else if(len==2){ return temp->next; } else{ return recurmid(temp->next,len-2); } }
@ironManToinfinity
@ironManToinfinity Жыл бұрын
Really amazing sir!!! fully understood both the questions approach and feel more confident about linked list now !
@avibirla9863
@avibirla9863 2 жыл бұрын
Bhaiya maza aa gaya itne approaches dekhke ♥️♥️💥💥💥💥
@AbhishekKumar-nz9dn
@AbhishekKumar-nz9dn 2 жыл бұрын
bhaiya bohot badiya . koi jwab nahi aaaapkaaa
@robinsinghkhural5307
@robinsinghkhural5307 6 ай бұрын
h/w sol -> using recursion is as follows : node* reverse(node* &head){ if(head==NULL || head->next==NULL){ return head; } node* chhota_head = reverse(head->next); head->prev = head->next; head->next->next = head; head->next =NULL; return chhota_head; }
@vishakhasinghal465
@vishakhasinghal465 Жыл бұрын
Here are two approaches for reverse doubly linked list : Approach-1: (Iterative) Node* reverseDLL(Node* head) { if (head == NULL || head->next == NULL) { return head; } Node* forward = NULL; Node* prev = NULL; Node* curr = head; while (curr != NULL) { forward = curr->next; curr->next = prev; curr->prev = forward; prev = curr; curr = forward; } return prev; } Approach-2: (Recursive) Node* reverseDLL(Node* head) { if(head == NULL || head -> next == NULL) { return head; } Node* newHead = reverseDLL(head -> next); head->next->next=head; head->prev=head->next; head->next=NULL; return newHead; }
@ritikamehta9791
@ritikamehta9791 2 жыл бұрын
Sir do make a practice sheet to solve all the important questions of linked list.!!✌
@divyanshuupadhyay9831
@divyanshuupadhyay9831 2 жыл бұрын
Middle of LL - code with better run time🙃🙃🙃 int n = 1 ; Node* ans = head; while(head->next != NULL){ head = head->next; n++; if(n%2==0) ans = ans->next;} return ans;
@keshavarya7918
@keshavarya7918 2 жыл бұрын
Bhaiya jab OS series shuru hui (or COVID vala issue bhi) to is series ki consistency thodi kam ho gayi thi, tab doubt ho raha tha ki kya chal raha hai 🤔🤔🤔 Par pichle 3 din me aap nahi jaante kitni rahat mili hai😁😁😁 Sandeh karne ke liye maafi #BelieveInBabbar
@JatinKumar-w7f
@JatinKumar-w7f 8 ай бұрын
well it is needed to take that condition if(head->next->next == NULL){return head->next;} because if the list has only two element so in this case second element would be our middle
@shyamparoha4236
@shyamparoha4236 8 ай бұрын
great teaching bhaiya bhautt ache se smj aagya aur last apporach me jo base case hai 2 node ke liye vo jarurui ni hai
@nancysinghal9767
@nancysinghal9767 2 жыл бұрын
Thanks bhaiyaa......your hard work matters...... Present bhaiyaa 🙋‍♀
@NYSWorld
@NYSWorld 2 жыл бұрын
reverse doubly linked list code below void reverse(node*&head){ node*current=head; node*prev=NULL; node*forward=NULL; while(current!=NULL){ forward=current->next; current->pre=current->next; current->next=prev; prev=current; current=forward; } head=prev; }
@chaitanyanaik5944
@chaitanyanaik5944 2 жыл бұрын
Bro instead of writing current->pre=current->next; you can write " current->pre=forward" also i saw on vs code it is working , as link is not broken cause we have not assigned the current's next link to prev (NULL) we have the access for it . I was a bit Stuck But Your solution helped me . Thanks!!!!
@aravchauhan9186
@aravchauhan9186 Жыл бұрын
why are u taking a second prev when in dll there is already a prev defined in the class ,shouldn't it be named something else.
@udaypratapsingh8923
@udaypratapsingh8923 2 жыл бұрын
hidden patriotism in these lectures
@yashgupta4866
@yashgupta4866 2 жыл бұрын
Confidence on linked list ++
@shubhangkarsaha2457
@shubhangkarsaha2457 3 ай бұрын
reverse doubly-linked-list code done sol -> void reverseList (Node* &head, Node* &tail) { if (head == NULL) { return; } Node* temp = head; Node* prev = NULL; while (temp != NULL) { Node* forward = temp -> next; temp -> next = temp -> prev; temp -> prev = forward; prev = temp; temp = forward; } tail = head; head = prev; }
@veerpalsingh6059
@veerpalsingh6059 8 күн бұрын
h.w--- to reverse a doubly linked list void reverse(Node* &head){ int l=len(head); int cnt=1; while(l>cnt){ head=head->next; cnt++; } cnt=0; while(l>cnt){ cout
@sounaksaha1455
@sounaksaha1455 2 жыл бұрын
Hum support karte hai, bhaiye..... dil se support karte hai....... kudos to your efforts
@anuptewary3016
@anuptewary3016 2 жыл бұрын
Present bhaiya with lot's of love and support to you ❤️🔥
@iEntertainmentFunShorts
@iEntertainmentFunShorts 2 жыл бұрын
Completed 2nd lecture on linked list
@manishrawat3791
@manishrawat3791 2 жыл бұрын
bhaiya course consistency on it's peak
@abhyaskanaujia3862
@abhyaskanaujia3862 2 жыл бұрын
Thank you so much for all of your efforts. Please take care of your health too.
@SriniVas-mx1li
@SriniVas-mx1li 2 жыл бұрын
Thanq bhai for the wonderful content 🥳🌟 Attendance from Andhra Pradesh 🥳 Present Sir!
@Magical_flute
@Magical_flute Жыл бұрын
Bhaiya tussi great ho❤ love from chhattisgarh
@AdityaKumar-be7hx
@AdityaKumar-be7hx Жыл бұрын
Both recursive and iterative methods for reversing a DLL Node* reverseDLL(Node* head) { if(head==nullptr || head->next==nullptr) return head; Node* curr=head; Node* prev=nullptr; while(curr!=nullptr){ prev=curr->prev; Node* forward = curr->next; curr->next = prev; curr->prev = forward; prev=curr; curr=forward; } return prev; } Node* reverseDLL(Node* head) { if(head==nullptr || head->next==nullptr) return head; Node* reversedHead = reverseDLL(head->next); head->next->next=head; head->prev = head->next; head->next=nullptr; return reversedHead; }
@keshavgambhir9894
@keshavgambhir9894 2 жыл бұрын
Present Bhaiya Amazing Course
@malharnimavat7676
@malharnimavat7676 2 жыл бұрын
Recursion mastt clear ho gaya sirr, Thanks a lot
@snehasish-bhuin
@snehasish-bhuin 2 жыл бұрын
Very good content👍👍👍👍👍👍. Lovely representation and great analysis. 🥳🥳🥳🥳🥳🥳🥳💕💕💕💕💕💕 Love from Kolkata. Hero++, Consistentcy++.
@suchetapal713
@suchetapal713 2 жыл бұрын
H/W: Doubly LL reversal Node* reverse(Node* head) { if(head==NULL || head->next==NULL) { return head; } Node* ans = reverse(head->next); head->next->next = head; head->prev = head->next; head->next = NULL; return ans; }
@shreyanshthakur5405
@shreyanshthakur5405 2 жыл бұрын
Love bhaiya to small linked list - "Chhoti LinkedList Ho Kyaa!!" . Jokes apart Seriously awesome lecture bhaiya.
@prashantbirajdar9271
@prashantbirajdar9271 2 жыл бұрын
mast bhaiyaa badhiya ekdum❤ sub smj aya🤩👍🙌
@_SHUBHANKARJENA
@_SHUBHANKARJENA 2 жыл бұрын
attendance marked. nice video
@rachit_joshi
@rachit_joshi 8 ай бұрын
Thank You So Much BHRATA SHREE !!!!!!!
@chaitanyasawant776
@chaitanyasawant776 2 жыл бұрын
Eagerly waiting for this thank you bhaiya
@tannubansal1718
@tannubansal1718 2 жыл бұрын
Consistency++++.. thankyou bhaiya ❤️
@striverop
@striverop 2 жыл бұрын
GALAT INCREMENT KR DIYA ERROR AA JAYEGA😂😂
@B-NikhilRichhariya
@B-NikhilRichhariya Жыл бұрын
nhi wo do node wale ko check krne ki zarurt nhi agar do nodes rahi toh slow ek aage badhega, fast ek aage badhega but ek aur nhi badh paayega cause ab wo NULL ho chuka hoga and 2 even nodes h toh middle m right wala ie second node jispe slow aa chuka h wo answer hai toh algo waha bhi kaam krega
@03_abhishekchoubey42
@03_abhishekchoubey42 2 жыл бұрын
Thanks bhiya for your amazing explanation it really helps me a lot😍
@ayanshijnn1028
@ayanshijnn1028 24 күн бұрын
2 nodes wala case chalane ki koi need nhi h because the first thing is question me bol rahka h ki head ki farther node hi mid node hogi
@VivekYadav-ir2qf
@VivekYadav-ir2qf 2 жыл бұрын
Excellent bhaiya. Thanks bhaiya for ur all efforts 💕💕
@anishbarnwal5676
@anishbarnwal5676 Жыл бұрын
Thankyou bhaiya for this awesome lecture
@ancymaria3907
@ancymaria3907 2 жыл бұрын
Hi love...subtitles are not available for the previous two videos..kindly pls add subtitles
@labib28
@labib28 8 ай бұрын
Node *findMiddle(Node *head) { if(head==NULL) return head; Node* fast=head; Node* slow=head; while(fast!=NULL and fast->next!=NULL){ fast=fast->next->next; slow=slow->next; } return slow; }
@nikhilpandey5671
@nikhilpandey5671 2 жыл бұрын
Bhaiya please linked list ke topic me alag se question ki video ya list share kr dijiye
@coderwork8335
@coderwork8335 Жыл бұрын
Are bhai thank u bhai bohot badiya
@jaspreetpannu4264
@jaspreetpannu4264 2 жыл бұрын
attendance marked!!! mja aagya
@PRIYANSHUKUMAR-un9zu
@PRIYANSHUKUMAR-un9zu 2 жыл бұрын
Thanks brother Present bhaiya 🔥❤
@piyush_kashyap23
@piyush_kashyap23 2 жыл бұрын
Thank you bhai❤ 2:00
@umangsachdeva9920
@umangsachdeva9920 2 жыл бұрын
Wah bahiya apne toh ek do din ki moj kra di😅🤣🤣 Ab toh ek hafta moj se katega👍👍🤗😝
@jaydwarkadhish959
@jaydwarkadhish959 2 жыл бұрын
Sir amazing video
@rohankumarmainali266
@rohankumarmainali266 2 жыл бұрын
Little optimization on Middle of LL // if we take fast = head instead of fast = head -> next then there is no if condition required class Solution { public: ListNode* middleNode(ListNode* head) { if(head->next ==NULL) return head; if(head->next->next == NULL) return head->next; ListNode * slow = head; ListNode * fast = head; while(fast!=NULL && fast->next!=NULL){ slow = slow->next; fast = fast->next->next; } return slow; } };
@iutkarshmehta
@iutkarshmehta 2 жыл бұрын
Attendance marked Reach++
@deepikarani4625
@deepikarani4625 2 жыл бұрын
mst bhaiya aaple hi bta dijiye ki add hai ye acha lga
@priyanshugoyal2539
@priyanshugoyal2539 2 жыл бұрын
Present Bhaiya Ji
@sagarsharma7671
@sagarsharma7671 2 жыл бұрын
Thanx a lot bhaiya from the bottom of my heart ❤
@sachitdhamija1884
@sachitdhamija1884 2 жыл бұрын
best time : 15:27 kyu good last time :bhi mast
@Ayush_.
@Ayush_. 2 жыл бұрын
Babbar Bhaiya 5 month INTERNSHIP STRATEGY Series laao plzzz DSA busted course ko as Resource rakhkar
@amishapandey6875
@amishapandey6875 Жыл бұрын
Well explained!
@KAMLESHGURJAR-y3z
@KAMLESHGURJAR-y3z 4 ай бұрын
babbar sir ki jai ho
@I_Anupam_Pandey
@I_Anupam_Pandey 2 жыл бұрын
Lecture 45 attendance thank you bhaiya for uploading daily 1 hour video
@muditpant9071
@muditpant9071 2 жыл бұрын
Best instructor🔥🔥🔥
@vansh6214
@vansh6214 7 ай бұрын
Hw solution- Node* reverseDLL(Node* head) { if(head==NULL || head->next==NULL){//for single node or empty list return head; } Node* prev=NULL; Node*curr=head; Node*forward=NULL; while(curr!=NULL){ forward=curr->next; curr->next=prev; curr->prev=forward; prev=curr; curr=forward; } return prev; }
@utsavseth6573
@utsavseth6573 Жыл бұрын
Wonderful work.
@mehulsaraswat2688
@mehulsaraswat2688 2 жыл бұрын
Cout
@ArpitKumar-yo6up
@ArpitKumar-yo6up 2 жыл бұрын
bhaiya is a magician
CodeHelp Weekly Contest 4 is LIVE || Contest Editorial/Solutions
3:35
CodeHelp - by Babbar
Рет қаралды 49 М.
World’s strongest WOMAN vs regular GIRLS
00:56
A4
Рет қаралды 28 МЛН
Random Emoji Beatbox Challenge #beatbox #tiktok
00:47
BeatboxJCOP
Рет қаралды 58 МЛН
How Strong is Tin Foil? 💪
00:25
Brianna
Рет қаралды 66 МЛН
Happy birthday to you by Secret Vlog
00:12
Secret Vlog
Рет қаралды 5 МЛН
Lecture 44: Linked List & its types - Singly, Doubly, Circular etc.
2:21:18
CodeHelp - by Babbar
Рет қаралды 1,5 МЛН
Reverse a Single Linked List
11:57
Neso Academy
Рет қаралды 276 М.
Lecture 49: Merge 2 Sorted Linked Lists || Sort 0s, 1s and 2s in Linked List
58:44
Lecture 48: Remove Duplicates from a Sorted/UnSorted Linked List
27:25
CodeHelp - by Babbar
Рет қаралды 194 М.
Lecture 42: OOPs Concepts in C++ || Part-1
1:29:14
CodeHelp - by Babbar
Рет қаралды 1,6 МЛН
2.8 Reverse a Linked List - Iterative Method | Data Structure Tutorials
18:44
Jenny's Lectures CS IT
Рет қаралды 431 М.
Lecture 52: Clone a Linked List with Random Pointers || C++ Placement Course
55:08
World’s strongest WOMAN vs regular GIRLS
00:56
A4
Рет қаралды 28 МЛН