Odd Even Linked List (LeetCode 328) | Full solution with diagrams | Study Algorithms

Поделиться
HTML-код
  • Опубликовано: 8 сен 2024

Комментарии • 66

  • @6lack-Echo
    @6lack-Echo Год назад +23

    please dont ever stop making videos, you have the best explanations !

    • @nikoo28
      @nikoo28  Год назад +6

      If only I get a few more subscribers 😅

    • @pranithreddy
      @pranithreddy 8 месяцев назад

      I am new one please dont stop@@nikoo28

  • @Ranjeeta_is_it_you
    @Ranjeeta_is_it_you Год назад +5

    i wish all of the leetcode problem' s solutions explained by you.Than you for the explanation!! :))

  • @likhansarkar1200
    @likhansarkar1200 Год назад +2

    thanks for this, i see everyone creating new lists, thats using extra space!!

  • @samridhshubham8109
    @samridhshubham8109 6 месяцев назад +1

    Perfect Approach
    Perfect Explanation
    Perfect Drawing to understand better

    • @nikoo28
      @nikoo28  5 месяцев назад +1

      simply lovely

  • @Satya-g5t
    @Satya-g5t 9 дней назад

    always good elegant explanation

  • @UMAR-ov7mf
    @UMAR-ov7mf 14 дней назад

    Thanks Nikhli for such an awesome solution

  • @user-ty1sd8xh7o
    @user-ty1sd8xh7o 6 месяцев назад

    Honestly the best explanation out here, please continue your great work.

  • @himanshuvaishya9164
    @himanshuvaishya9164 11 месяцев назад

    I have seen many videos for this problem but your teaching method is best and easy to visualise

    • @nikoo28
      @nikoo28  10 месяцев назад

      i like visual solutions

  • @shivacoding
    @shivacoding 4 месяца назад

    Please do all leetcode problem videos, you are one and only the best.

  • @LogicTherapy
    @LogicTherapy 2 месяца назад

    that was really well done

  • @funnymoment9164
    @funnymoment9164 Год назад +2

    Thanks! Cool explanation.

  • @studentchampion718
    @studentchampion718 Месяц назад

    Nice Explanation

  • @ankit_yr_senpai
    @ankit_yr_senpai Месяц назад

    best explanation sir

  • @smandal1237
    @smandal1237 4 месяца назад

    thank you so much..plzz dont"t stop

    • @nikoo28
      @nikoo28  4 месяца назад

      I will try my best

  • @alexgu3257
    @alexgu3257 3 месяца назад

    Really clear explanation, thanks!

  • @Shadowxgaming_
    @Shadowxgaming_ 7 месяцев назад +1

    best explanantion bhaiya , thanks you so much

  • @shivacoding
    @shivacoding 4 месяца назад

    You deserve 1 million Subscribers.❣

  • @abdessamadsabouri7927
    @abdessamadsabouri7927 17 дней назад

    TOP!! Thank u !

  • @AbhinavKumar-dl2ph
    @AbhinavKumar-dl2ph 3 месяца назад +1

    Why we do not have condition for odd in while loop ? while(odd!=null) ?

  • @satestactmathtutor6570
    @satestactmathtutor6570 Год назад

    best explanation on youtube how you donot have 100 k views ,, it will come broo do not worry just keep going and do not stop making videos plzzzz

    • @nikoo28
      @nikoo28  10 месяцев назад

      please share as much as possible :)

  • @sanjammanagi6562
    @sanjammanagi6562 Год назад +1

    great explanation sir

  • @swethak3505
    @swethak3505 3 месяца назад

    Thanks for the explanation

  • @devu5501
    @devu5501 5 месяцев назад

    You have the great explanation really ❤

    • @nikoo28
      @nikoo28  4 месяца назад

      Thank you! 😃

  • @WebMaster600
    @WebMaster600 8 месяцев назад +1

    Cool bro 😎

  • @jaysingh-rn6ge
    @jaysingh-rn6ge 7 месяцев назад +1

    Thank you

  • @TheSachinAlam
    @TheSachinAlam Год назад

    Best explanation ever!!!

    • @nikoo28
      @nikoo28  Год назад

      Glad you think so!

  • @syedtaqi54
    @syedtaqi54 Год назад +2

    Hello Nikhil can u please make video on "Flatten a Linked List"

    • @nikoo28
      @nikoo28  Год назад +1

      Can you describe the problem statement?

    • @nikoo28
      @nikoo28  Год назад +1

      Or a link to the problem…where can I find it!

  • @jayprakashjaiswaldeptofcom1250
    @jayprakashjaiswaldeptofcom1250 Год назад +3

    Bhaiya please thora frequent video upload karo

    • @nikoo28
      @nikoo28  Год назад +5

      i keep trying...but it takes me almost 10 hours to produce 1 video from scratch. Thinking about a problem, simplifying it as much as I can, creating all those images and diagrams, recording, editing, publishing with all the links, creating thumbnails. It is a very lengthy process along with my day job and a married life.
      Thanks for all your support and patience, I try to be as consistent as possible and want to focus on quality over quantity. Hope I retain you as my viewer. :)

    • @kulkarnisoham
      @kulkarnisoham Год назад +1

      @@nikoo28 😱😱 10 hours! really? hats off.. So this is the reason behind lucid explanation and the clean slides. Best of luck brother

  • @subee128
    @subee128 8 месяцев назад +1

    Thanks

  • @sobitregmi31
    @sobitregmi31 Год назад

    Great explanation bro

  • @kunalkheeva
    @kunalkheeva Год назад +1

    Great!

  • @rishavranjan6656
    @rishavranjan6656 10 месяцев назад

    Your explanation is always the BEST and one more thing to ask are you a Tifosi (Ferrari Fan) and specially Seb fan ?

    • @nikoo28
      @nikoo28  10 месяцев назад +1

      Sharp observation I must say.. 😄
      Yes..a Ferrari fan..but that isn’t working out lately 😂

    • @rishavranjan6656
      @rishavranjan6656 10 месяцев назад

      @@nikoo28 yeah Ferrari strategies are so brute force they don't think of optimised strategies 😂

  • @pcccmn
    @pcccmn Год назад

    I think you are so much better at teaching than NeetCode and TechDose =)

  • @wenkaiyang1487
    @wenkaiyang1487 8 месяцев назад +1

    why don't you set odd = odd.next.next instead of odd.next = odd.next.next; and odd = odd.next?

    • @wickedgabrugamer
      @wickedgabrugamer 8 месяцев назад +1

      this will not alter the pointers, it will just move the odd pointer to next.next. so 1st alter and then move.

  • @Interestingseriesclips
    @Interestingseriesclips Месяц назад

    Hi Sir ,I am big fan of your explanation. I just want to know is this code is good or not
    public ListNode oddEvenList(ListNode head) {
    ListNode last=head;
    if(head==null || head.next==null || head.next.next==null)
    return head;
    while(last.next!=null){
    last=last.next;
    }
    ListNode s=last;
    ListNode prev=head;
    while(prev!=s && prev.next!=s){
    last.next=prev.next;
    prev.next=prev.next.next;
    last=last.next;
    last.next=null;
    prev=prev.next;
    }
    if(prev.next==s){
    prev.next=prev.next.next;
    last.next=s;
    s.next=null;
    }
    return head;
    }
    leetcode accepted this solution but just want to know its optimal or not

  • @meghasingh9170
    @meghasingh9170 2 месяца назад

    Why is the while loop condition : "while even and even.next" and not "while odd and odd.next"?

    • @sidharthan3349
      @sidharthan3349 15 дней назад

      same doubt, did you find the reason?

  • @viking8774
    @viking8774 5 месяцев назад

    Sir can you explain.
    Split the linked list in 2 halves where one list contains only odd values and other contains only even values

    • @nikoo28
      @nikoo28  4 месяца назад

      What do you mean?

    • @viking8774
      @viking8774 4 месяца назад

      @@nikoo28 I mean to say
      One half contains odd data and other half contains even data

    • @nikoo28
      @nikoo28  Месяц назад

      i get it..but that is the goal of the question. I couldn't understand what are you asking over here?

  • @tyy899
    @tyy899 Месяц назад

    why this is not getting worked while(even.next!=null&&odd.next!=null)
    { this loop condition bro can you help me out .. :)

  • @user-nf5vg9pu5r
    @user-nf5vg9pu5r 5 месяцев назад

    The code not working for odd length linked list

  • @Rahulkumar-vn1vm
    @Rahulkumar-vn1vm 6 месяцев назад

    why we cant use while odd!=Null and odd!=Null instead of even????

    • @nikoo28
      @nikoo28  5 месяцев назад

      please clarify

    • @subhamagarwal476
      @subhamagarwal476 2 месяца назад

      Because if you carefully see. Even will reach the null very soon as compared to odd because it is starting one after odd. So if we save even check somehow then we will definitely save odd thats for sure . So we are putting condition like while (even != null)

  • @kidoo1567
    @kidoo1567 10 месяцев назад

    Nikil...can u do sums for stack and queue?

    • @nikoo28
      @nikoo28  10 месяцев назад

      do you have specific problems in mind?

  • @likhithakande2902
    @likhithakande2902 Год назад

    😛😛😛

  • @likhithakande2902
    @likhithakande2902 Год назад

    😝😝😝

  • @plutomessi21
    @plutomessi21 Год назад +1

    thank you bhaiya