I watched lot's of video about this topic every body is mixing reversed in same code but you made a separate method for reversed that made to understand this problem, Love your approach 💞
I'm sorry but what do you mean put all of them in arraylist and compare? Do you mean put all in arraylist and then use for loop to see if it starts from the back, it equals the original?
Hi, Since this question is super important and it is frequently asked, can we discuss a better solution than this? Although it is accepted by LeetCode, the interviewer would say that my Linked List got broken, I could offer to re-reverse the second half and put the list back together. But the interviewer would further note that the proposed solution is not suitable for a concurrent environment, where multiple threads or processes may concurrently access the same data. And for sure, one potential disadvantage of modifying a Linked List is that it can temporarily disrupt the structure of the list, which can cause issues if other threads or processes try to access the list at the same time. One answer to avoid such issues can be to use locks or other synchronization mechanisms to ensure that only one thread or process can access the list while it is being modified. But the interviewer will confirm that this can add additional overhead and complexity to the code. SUMMARY: a nightmare :D Can you discuss O(1) space complexity other than modify the list in place? I would much appreciate it if you get back to me. Best, Nataša
Thanks for the clear code and explanation! Also glad to see complexities get mentioned at the end as well.
You bet! Thanks!
I'm very surprised that your channel doesn't have more views than it does yet... keep up the awesome work!!!
Thanks, will do! :)
I watched lot's of video about this topic every body is mixing reversed in same code but you made a separate method for reversed that made to understand this problem,
Love your approach 💞
Glad it helped!
@@FisherCoder why don't you continue to upload videos?
I watched a couple of videos from different channels with the same problem but your video was the best. Thank you :)
Glad to hear that!
Clearly and conceptually explained🔥🔥
Glad you liked it! :)
Clear and awesome explanation, keep it up!
Glad it was helpful!
What if its a odd string ? There would be an extra element
Hey, thanks a ton for doing these! I am coming from your answer on quora.
Glad that you made it here! Cheers! :)
I'm sorry but what do you mean put all of them in arraylist and compare? Do you mean put all in arraylist and then use for loop to see if it starts from the back, it equals the original?
@@skankhunt-mt5uz yes but it requires O(n) space
Hi,
Since this question is super important and it is frequently asked, can we discuss a better solution than this?
Although it is accepted by LeetCode, the interviewer would say that my Linked List got broken, I could offer to re-reverse the second half and put the list back together.
But the interviewer would further note that the proposed solution is not suitable for a concurrent environment, where multiple threads or processes may concurrently access the same data.
And for sure, one potential disadvantage of modifying a Linked List is that it can temporarily disrupt the structure of the list, which can cause issues if other threads or processes try to access the list at the same time.
One answer to avoid such issues can be to use locks or other synchronization mechanisms to ensure that only one thread or process can access the list while it is being modified.
But the interviewer will confirm that this can add additional overhead and complexity to the code.
SUMMARY: a nightmare :D
Can you discuss O(1) space complexity other than modify the list in place?
I would much appreciate it if you get back to me.
Best,
Nataša
this is extremely helpful thank you
Glad it helped!
Great video I wish it was clearer how the linked list is split in place.
Thank you very much for the clear explanation :)~
You are welcome!
great explanation! thank you! :D
Glad it was helpful!
GOD DAMNN THAT WAS HARDER THAN I THOT
I think you should have mentioned that it is a good practice to keep the linkedlist in its original form before returning the answer.
thank you :)
You're welcome!
Thanks! I am subbing
Awesome, thank you!