LeetCode 234: Palindrome Linked List - Interview Prep Ep 63

แชร์
ฝัง
  • เผยแพร่เมื่อ 29 พ.ย. 2024

ความคิดเห็น • 32

  • @vaibhavm1007
    @vaibhavm1007 4 ปีที่แล้ว +6

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

  • @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 💞

  • @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!!!

  • @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 :)

    • @FisherCoder
      @FisherCoder  4 ปีที่แล้ว +1

      Glad to hear that!

  • @algorithmfrombasic9892
    @algorithmfrombasic9892 4 ปีที่แล้ว +2

    Clearly and conceptually explained🔥🔥

    • @FisherCoder
      @FisherCoder  4 ปีที่แล้ว

      Glad you liked it! :)

  • @jerryyang7058
    @jerryyang7058 3 ปีที่แล้ว +2

    Clear and awesome explanation, keep it up!

    • @FisherCoder
      @FisherCoder  3 ปีที่แล้ว

      Glad it was helpful!

  • @rsKayiira
    @rsKayiira 3 ปีที่แล้ว +1

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

  • @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.

  • @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

  • @free-palestine000
    @free-palestine000 4 ปีที่แล้ว +1

    this is extremely helpful thank you

  • @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 3 ปีที่แล้ว +2

    great explanation! thank you! :D

    • @FisherCoder
      @FisherCoder  3 ปีที่แล้ว

      Glad it was helpful!

  • @benyaminyakobi3652
    @benyaminyakobi3652 3 ปีที่แล้ว +1

    Thank you very much for the clear explanation :)~

  • @BetterEverydayHD
    @BetterEverydayHD ปีที่แล้ว +1

    GOD DAMNN THAT WAS HARDER THAN I THOT

  • @BrendanMetcalfe
    @BrendanMetcalfe 4 ปีที่แล้ว +1

    Thanks! I am subbing

  • @MiddleEasternInAmerica
    @MiddleEasternInAmerica 4 ปีที่แล้ว +1

    thank you :)