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. :)
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
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)
please dont ever stop making videos, you have the best explanations !
If only I get a few more subscribers 😅
I am new one please dont stop@@nikoo28
i wish all of the leetcode problem' s solutions explained by you.Than you for the explanation!! :))
thanks for this, i see everyone creating new lists, thats using extra space!!
Perfect Approach
Perfect Explanation
Perfect Drawing to understand better
simply lovely
always good elegant explanation
Thanks Nikhli for such an awesome solution
Honestly the best explanation out here, please continue your great work.
I have seen many videos for this problem but your teaching method is best and easy to visualise
i like visual solutions
Please do all leetcode problem videos, you are one and only the best.
that was really well done
Thanks! Cool explanation.
Nice Explanation
best explanation sir
thank you so much..plzz dont"t stop
I will try my best
Really clear explanation, thanks!
best explanantion bhaiya , thanks you so much
You deserve 1 million Subscribers.❣
TOP!! Thank u !
Why we do not have condition for odd in while loop ? while(odd!=null) ?
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
please share as much as possible :)
great explanation sir
Thanks for the explanation
You have the great explanation really ❤
Thank you! 😃
Cool bro 😎
Thank you
Best explanation ever!!!
Glad you think so!
Hello Nikhil can u please make video on "Flatten a Linked List"
Can you describe the problem statement?
Or a link to the problem…where can I find it!
Bhaiya please thora frequent video upload karo
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. :)
@@nikoo28 😱😱 10 hours! really? hats off.. So this is the reason behind lucid explanation and the clean slides. Best of luck brother
Thanks
Great explanation bro
Great!
Your explanation is always the BEST and one more thing to ask are you a Tifosi (Ferrari Fan) and specially Seb fan ?
Sharp observation I must say.. 😄
Yes..a Ferrari fan..but that isn’t working out lately 😂
@@nikoo28 yeah Ferrari strategies are so brute force they don't think of optimised strategies 😂
I think you are so much better at teaching than NeetCode and TechDose =)
why don't you set odd = odd.next.next instead of odd.next = odd.next.next; and odd = odd.next?
this will not alter the pointers, it will just move the odd pointer to next.next. so 1st alter and then move.
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
Why is the while loop condition : "while even and even.next" and not "while odd and odd.next"?
same doubt, did you find the reason?
Sir can you explain.
Split the linked list in 2 halves where one list contains only odd values and other contains only even values
What do you mean?
@@nikoo28 I mean to say
One half contains odd data and other half contains even data
i get it..but that is the goal of the question. I couldn't understand what are you asking over here?
why this is not getting worked while(even.next!=null&&odd.next!=null)
{ this loop condition bro can you help me out .. :)
The code not working for odd length linked list
why we cant use while odd!=Null and odd!=Null instead of even????
please clarify
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)
Nikil...can u do sums for stack and queue?
do you have specific problems in mind?
😛😛😛
😝😝😝
thank you bhaiya