2385. Amount of Time for Binary Tree to Be Infected | Graph | Tree | BFS | DFS | Microsoft

Sdílet
Vložit
  • čas přidán 8. 01. 2024
  • In this video, I'll talk about how to solve Leetcode 2385. Amount of Time for Binary Tree to Be Infected
    Problem Link: leetcode.com/problems/amount-...
    Checkout DSA-169 Series: • Aryan DSA-169 Series |...
    100Days 100k Placements: • 100 Days 100K Placement
    Let's Connect:
    📝Linkedin: / aryan-mittal-0077
    📸 Instagram: / ez.pz.dsa
    📱Telegram : t.me/aryan_mittal_group
    🤖 Github: github.com/aryan-0077
    About Me:
    I am Aryan Mittal - A Software Engineer in Goldman Sachs, Speaker, Creator & Educator. During my free time, I create programming education content on this channel & also how to use that to grow :)
    ✨ Timelines✨
    0:00 - Problem Explanation
    2:52 - Convert to Graph - Do a BFS
    13:24 - Tree - DFS - One Pass
    ✨ Hashtags ✨
    #programming #Interviews #leetcode #faang #maang #datastructures #algorithms

Komentáře • 13

  • @ARYANMITTAL
    @ARYANMITTAL  Před 6 měsíci +13

    I know, its a long video, but wanted to discuss One Pass approach too, as no-one on youtube discussed it ❤!!

  • @s20061002
    @s20061002 Před 6 měsíci +1

    My first intuition is using DFS approach but I stuck in calculating the max distance from start node to the farthest node...
    Your explanation is so clear that I finally understand whats going on of "min(left, right) - 1"
    appreciate 👍

  • @thomasshelby6780
    @thomasshelby6780 Před 12 dny

    you blew my brains up, and I'm not even exaggerating!

  • @RajGupta-cu9hi
    @RajGupta-cu9hi Před 6 měsíci +1

    I think it's similar to burn tree with a starting node 😊

  • @sidhanofficial2785
    @sidhanofficial2785 Před 6 měsíci +2

    Was waiting for this masterpiece 👏

  • @sanskarsharma6440
    @sanskarsharma6440 Před 6 měsíci

    Underrated, thanks

  • @codencode5546
    @codencode5546 Před 6 měsíci +2

    I don't exactly remember, but there is a similar problem like this.

  • @user-bf7yz3qd2i
    @user-bf7yz3qd2i Před 6 měsíci

    Bhai , please also solve geeksforgeeks POTD☺

  • @WiFiWaLaaa
    @WiFiWaLaaa Před 6 měsíci

    Propogation Algo : BFS/DFS