Remove Duplicates From Sorted Linked List

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

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

  • @samarthbhandari1360
    @samarthbhandari1360 7 лет назад +11

    You're doing a fantastic job! Keep it up! You have helped me tackle my personal fear of working with linked lists

  • @eng6070
    @eng6070 2 года назад

    best teaching ever sir! very clear explanation with detailed coding, thank you very much sir, it help me a lot!

  • @dipteshdeore5207
    @dipteshdeore5207 3 года назад +1

    You teach in very simple method 🔥... awesome !!

  • @srafayal
    @srafayal 2 года назад

    god bless you sir you have a versatile way of teaching

  • @FrozenByTheSun
    @FrozenByTheSun 7 лет назад

    I love the way you stress function names :D
    «Remove duplicates» is the name of the function ☝🏽» - 1:05

  • @AbhishekJain-pm2jn
    @AbhishekJain-pm2jn 3 года назад +1

    Very well explained sir 👏👌

  • @dhanashreerajeshwar823
    @dhanashreerajeshwar823 2 года назад

    hi sir, you really explain very well.

  • @LocNguyen-ky6bn
    @LocNguyen-ky6bn 4 года назад

    so useful for those beginners like me. Thank you so much

  • @minakshisingh1314
    @minakshisingh1314 5 лет назад +6

    Here is the simple code
    node * removeDuplicates(node * root)
    {
    // Your code here
    node * current = root;
    while(current != null && current->next != null)
    {
    if(current->data == current->next->data)
    current->next = current->next->next;
    else
    current = current->next;
    }
    return root;
    }

  • @dontknowwhatagoodnameis
    @dontknowwhatagoodnameis 7 лет назад +1

    Welcome back sir 🙂
    Btw the function name shouldn't have a '*', otherwise nice explanation as usual.

    • @vivekanandkhyade
      @vivekanandkhyade  7 лет назад

      Ohh Yess......!

    • @bhavyanayyer3391
      @bhavyanayyer3391 4 года назад

      by mistake he has written void as the actual function returns the head of the linked list

  • @younsineda1105
    @younsineda1105 3 года назад

    Sir , what if they told us to return the element that has the maximum occurrence and the number of apparition in a list ? . I hope u''ll answer me .
    Thanks in advance

  • @ahmedouyahya
    @ahmedouyahya 4 года назад +1

    Thank you sooooo much, it was very clear.

  • @penikmatteater1785
    @penikmatteater1785 4 года назад

    If the function is not void, which will be returned? head or p?

  • @grigtrig9804
    @grigtrig9804 6 лет назад +1

    Can you please upload a video in which the case is to delete all occurrences of a given key in a Singly and Doubly linked list

  • @maggie02683
    @maggie02683 6 лет назад +2

    THANK U SO MUCHHHHHHHHHHHHHHHHHHHHHHHH i feel so stupid for not being able to solve this on my own but ur videos are amazing so THANK U

  • @brijdi07
    @brijdi07 5 лет назад

    Really good explanation. But there is one issue, we are not deallocating memory for the node which gets removed.

  • @randeeprana5622
    @randeeprana5622 4 года назад

    thanku so much bro for clearing this topic

  • @dimpleshah3037
    @dimpleshah3037 4 года назад

    Osm.... Sir pls upload code in python too....

  • @RigzenBodhK_CO_
    @RigzenBodhK_CO_ 5 лет назад

    why didn't you delete the node

  • @abheejitjadhav9405
    @abheejitjadhav9405 5 лет назад

    the node which are unlinking should be memory leak... you should free that memory

  • @shivakrishna6393
    @shivakrishna6393 6 лет назад

    sir can u please explain the complete code (including main() function)with execution

  • @sonalisharma8915
    @sonalisharma8915 6 лет назад

    very informative :)

  • @devanshsolani2711
    @devanshsolani2711 4 года назад

    Bhai ye ek question ke liye 20 min kaun dalega?

  • @afjalsharifopu5058
    @afjalsharifopu5058 7 лет назад

    just awsome.....

  • @gajjar04akash
    @gajjar04akash 5 лет назад

    You forgot to free the node memory.

  • @saktiranjanbehera7010
    @saktiranjanbehera7010 5 лет назад

    Thanks a ton.

  • @NatureBeauty1202-R
    @NatureBeauty1202-R 6 лет назад

    sir OPTIMISATION ALGO pe vdo kijiye

  • @hemaladani4510
    @hemaladani4510 4 года назад

    Super

  • @syedshahabuddin5567
    @syedshahabuddin5567 6 лет назад

    You are not freeing that duplicate data using free function...

  • @surajtopal9940
    @surajtopal9940 4 года назад

    Thanks sir jii

  • @jaysahu357
    @jaysahu357 7 лет назад

    nice sir

  • @ranioctaviani5320
    @ranioctaviani5320 5 лет назад

    Thank u

  • @FrozenByTheSun
    @FrozenByTheSun 7 лет назад

    Subbed

  • @فراشةالربيع-ع4ص
    @فراشةالربيع-ع4ص 4 года назад

    اتمنى لو يكون في ترجمه للشرح بالعربي

  • @فراشةالربيع-ع4ص
    @فراشةالربيع-ع4ص 4 года назад

    Sorry I thought you were speaking Hindi

  • @vedavyasa9542
    @vedavyasa9542 7 лет назад

    Simplest solution(JAVA)
    ListNode curr = head;
    while(curr!=null && curr.next!= null){
    if(curr.val == curr.next.val){
    curr.next = curr.next.next;
    }else{
    curr = curr.next;
    }
    }