LeetCode 234: Palindrome Linked List - Interview Prep Ep 63

Поделиться
HTML-код
  • Опубликовано: 12 ноя 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.

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

  • @algorithmfrombasic9892
    @algorithmfrombasic9892 4 года назад +2

    Clearly and conceptually explained🔥🔥

  • @jerryyang7058
    @jerryyang7058 3 года назад +2

    Clear and awesome explanation, keep it up!

  • @pallav2883
    @pallav2883 3 года назад +4

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

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

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

  • @rsKayiira
    @rsKayiira 3 года назад +1

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

  • @benyaminyakobi3652
    @benyaminyakobi3652 3 года назад +1

    Thank you very much for the clear explanation :)~

  • @lukehatcher98
    @lukehatcher98 3 года назад +2

    great explanation! thank you! :D

  • @BetterEverydayHD
    @BetterEverydayHD Год назад +1

    GOD DAMNN THAT WAS HARDER THAN I THOT

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

  • @MiddleEasternInAmerica
    @MiddleEasternInAmerica 4 года назад +1

    thank you :)

  • @BrendanMetcalfe
    @BrendanMetcalfe 4 года назад +1

    Thanks! I am subbing