Remove Duplicates From Sorted Linked List
Vložit
- čas přidán 26. 12. 2017
- Remove Duplicates From Unsorted Linked List. This works for multiple occurrences.
Remove Duplicates (2 occurrences) video :- • Remove duplicate ( 2 o...
Github code :- github.com/vivekanand44/codes...
You're doing a fantastic job! Keep it up! You have helped me tackle my personal fear of working with linked lists
best teaching ever sir! very clear explanation with detailed coding, thank you very much sir, it help me a lot!
You teach in very simple method 🔥... awesome !!
god bless you sir you have a versatile way of teaching
Very well explained sir 👏👌
I love the way you stress function names :D
«Remove duplicates» is the name of the function ☝🏽» - 1:05
Thank you sooooo much, it was very clear.
hi sir, you really explain very well.
so useful for those beginners like me. Thank you so much
thanku so much bro for clearing this topic
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;
}
free the memory
just awsome.....
very informative :)
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
Thanks a ton.
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
Really good explanation. But there is one issue, we are not deallocating memory for the node which gets removed.
nice sir
sir can u please explain the complete code (including main() function)with execution
If the function is not void, which will be returned? head or p?
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
Thank u
Osm.... Sir pls upload code in python too....
Welcome back sir 🙂
Btw the function name shouldn't have a '*', otherwise nice explanation as usual.
Ohh Yess......!
by mistake he has written void as the actual function returns the head of the linked list
Super
Thanks sir jii
sir OPTIMISATION ALGO pe vdo kijiye
the node which are unlinking should be memory leak... you should free that memory
Subbed
Bhai ye ek question ke liye 20 min kaun dalega?
why didn't you delete the node
You forgot to free the node memory.
You are not freeing that duplicate data using free function...
اتمنى لو يكون في ترجمه للشرح بالعربي
Sorry I thought you were speaking Hindi
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;
}
}