Swap Every Two Nodes in a Linked List | Data Structures & Algorithms

Поділитися
Вставка
  • Опубліковано 3 жов 2024
  • Join Jomaclass for full-length videos like this: joma.tech/dsa

КОМЕНТАРІ • 9

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

    I really love your videos. Keep up the good work and you will be adored by everyone.

  • @RawPeds
    @RawPeds 3 роки тому

    Thanks for the video: it's a good stimulus to get to solve funny problems.

  • @safeeullahsaifuddin1147
    @safeeullahsaifuddin1147 3 роки тому

    Thanks for the video! Could you make one going over how to find time and space complexity?

  • @DarthVader-wm6tf
    @DarthVader-wm6tf 3 роки тому

    Hey joma ... Thanks for your videos .. they're really helpful ... I'm waiting for your improved animated videos ...

  • @LawrenceDCodes.
    @LawrenceDCodes. 3 роки тому

    Very good 👍🏾

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

    Wait. Nodes are never actually swapped. Only the values are!
    Baited :D.
    By the way, I tried my solution. Here it is.
    def solve(a):
    if (!a) return null
    if (!a.next) return n
    after = solve(a.next.next)
    b = a.next # just renaming
    b.next = a
    a.next = after
    return b

  • @thecscontent5110
    @thecscontent5110 3 роки тому

    I also do videos about programming!😁

  • @mr.mystiks9968
    @mr.mystiks9968 2 роки тому

    Not hard at all actually, even if you literally swap the node references.

  • @KoreanBoysFishing
    @KoreanBoysFishing 3 роки тому

    yeye