Tree Rerooting | DP on trees | Advanced algos made easy!

Sdílet
Vložit
  • čas přidán 7. 09. 2024

Komentáře • 15

  • @arghyabarannaskar6407
    @arghyabarannaskar6407 Před 4 měsíci +1

    Wow! what an explanation with drawings.... You are a very good teacher...

  • @RP-qv9sc
    @RP-qv9sc Před rokem +3

    This is a good topic very frequent in recent coding tests

  • @aaravarya4406
    @aaravarya4406 Před rokem +5

    Rerooting is one of the technique I love the most. It's like father helping his children to solve their problem lol.
    And thanks for problem F, really enjoyed doing it.

    • @aaravarya4406
      @aaravarya4406 Před rokem +3

      Tip:- When it comes to rerooting, go dad mood :p

    • @Acodedaily
      @Acodedaily  Před rokem +2

      indeed a pretty interesting question! the question from cses and codeforces only differ slightly.
      The leetcode one is actually harder than LC this time :p although not that hard.

    • @RP-qv9sc
      @RP-qv9sc Před rokem +2

      @@Acodedaily please upload tutorial of q4 lc asap brother also if you can discuss whether this can be solved ujsing dp on trees would be great help

    • @aaravarya4406
      @aaravarya4406 Před rokem +1

      @RP409 My approach for this problem was to find a node such that any of it's two child subtree has 1 in it and the node lies in middle of their path. After that we can brute force to get minimum moves.

    • @Acodedaily
      @Acodedaily  Před rokem +1

      @@aaravarya4406 therre is a better and more intuitive way. I think I would make a video on this

  • @AkshaySharma-bg3oj
    @AkshaySharma-bg3oj Před měsícem

    Hey dude, thanks for the video :)

  • @Acodedaily
    @Acodedaily  Před rokem +3

    Discord server: discord.gg/H8TeFjvq6z
    Tree rerooting problems:
    cses: cses.fi/problemset/task/1133
    leetcode: leetcode.com/problems/difference-between-maximum-and-minimum-price-sum/description/
    codeforces: codeforces.com/contest/1092/problem/F

  • @harrypotteredits7265
    @harrypotteredits7265 Před rokem +1

    Thanks man

  • @secondthread-uc9bd
    @secondthread-uc9bd Před rokem

    you are a good teacher!

  • @anupdhoble2879
    @anupdhoble2879 Před 4 měsíci +1

    Just a little doubt , can we consider any node as root node and answer will be same????

  • @chewbaccazombie2489
    @chewbaccazombie2489 Před 4 měsíci

    okay but whats the answer to the question in the thumbnail?