LeetCode 234: Palindrome Linked List - Interview Prep Ep 63

Поділитися
Вставка
  • Опубліковано 9 січ 2025

КОМЕНТАРІ • 32

  • @vaibhavm1007
    @vaibhavm1007 4 роки тому +6

    Thanks for the clear code and explanation! Also glad to see complexities get mentioned at the end as well.

  • @wheresthebeach0138
    @wheresthebeach0138 4 роки тому +10

    I'm very surprised that your channel doesn't have more views than it does yet... keep up the awesome work!!!

  • @saddam_khan_abuzaid4201
    @saddam_khan_abuzaid4201 4 роки тому +3

    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 💞

  • @ehsanhosseini5861
    @ehsanhosseini5861 4 роки тому +1

    I watched a couple of videos from different channels with the same problem but your video was the best. Thank you :)

  • @jerryyang7058
    @jerryyang7058 3 роки тому +2

    Clear and awesome explanation, keep it up!

  • @rsKayiira
    @rsKayiira 3 роки тому +1

    Great video I wish it was clearer how the linked list is split in place.

  • @algorithmfrombasic9892
    @algorithmfrombasic9892 4 роки тому +2

    Clearly and conceptually explained🔥🔥

  • @pallav2883
    @pallav2883 3 роки тому +4

    What if its a odd string ? There would be an extra element

  • @guyipod98
    @guyipod98 4 роки тому +1

    I think you should have mentioned that it is a good practice to keep the linkedlist in its original form before returning the answer.

  • @momentime8582
    @momentime8582 4 роки тому +2

    Hey, thanks a ton for doing these! I am coming from your answer on quora.

    • @FisherCoder
      @FisherCoder  4 роки тому +1

      Glad that you made it here! Cheers! :)

    • @skankhunt-mt5uz
      @skankhunt-mt5uz 4 роки тому

      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?

    • @KaranDoshicool
      @KaranDoshicool 4 роки тому

      @@skankhunt-mt5uz yes but it requires O(n) space

  • @lukehatcher98
    @lukehatcher98 4 роки тому +2

    great explanation! thank you! :D

  • @free-palestine000
    @free-palestine000 4 роки тому +1

    this is extremely helpful thank you

  • @benyaminyakobi3652
    @benyaminyakobi3652 3 роки тому +1

    Thank you very much for the clear explanation :)~

  • @natasaivic8845
    @natasaivic8845 Рік тому

    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

  • @BrendanMetcalfe
    @BrendanMetcalfe 4 роки тому +1

    Thanks! I am subbing

  • @BetterEverydayHD
    @BetterEverydayHD Рік тому +1

    GOD DAMNN THAT WAS HARDER THAN I THOT

  • @MiddleEasternInAmerica
    @MiddleEasternInAmerica 4 роки тому +1

    thank you :)