Binary Tree Maximum Path Sum | (C++, Java, Python) | 30 day Challenge | Day 29 | LeetCode

แชร์
ฝัง
  • เผยแพร่เมื่อ 19 ก.ย. 2024
  • Complete Playlist LeetCode Solutions: • LeetCode Solutions | L...
    Diameter of Binary Tree: • LeetCode 30 day Challe...
    *** Best Books For Data Structures & Algorithms for Interviews:*********
    1. Cracking the Coding Interview: amzn.to/2WeO3eO
    2. Cracking the Coding Interview Paperback: amzn.to/3aSSe3Q
    3. Coding Interview Questions - Narasimha Karumanchi: amzn.to/3cYqjkV
    4. Data Structures and Algorithms Made Easy - N. Karumanchi: amzn.to/2U8FrDt
    5. Data Structures & Algorithms made Easy in Java - N. Karumanchi: amzn.to/2U0qZgY
    6. Introduction to Algorithms - CLR - Cormen, Leiserson, Rivest: amzn.to/2Wdp8rZ
    *****************************************************************************
    LeetCode 30 day Challenge | Problem 29 | Maximal Square | 29 April,
    Facebook Coding Interview question,
    google coding interview question,
    leetcode,
    Binary Tree Maximum Path Sum,
    Binary Tree Maximum Path Sum c++,
    Binary Tree Maximum Path Sum python,
    Binary Tree Maximum Path Sum java,
    binary tree,
    maximum path sum
    #Facebook #CodingInterview #LeetCode #30DayChallenge #Google #MaximumPathSum #Amazon

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

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

    Nice explanation -- thanks!

  • @singhharsh199
    @singhharsh199 2 ปีที่แล้ว

    variable naming needs to be improved.

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

    Thanks so much !👍👍

  • @acxd
    @acxd 4 ปีที่แล้ว +3

    your videos are good can you also tune in the audio ,your audio seems to have a lot of bass in it

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

      Thanks for advice. Will work on it.

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

    Great u have done as i was thinking relating to diameter problem ,u have used h1, h2 very nicely to bring complexity down to o(n ) from o(n2)

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

    what is the point of h.set()?

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

      Assign value to h (an AtomicInteger).
      h.set(10) ==> equivalent to int h = 10

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

      @@KnowledgeCenter yeah but how is it used in the context of the algorithm, h is only set once and it seems you forget about, when you call mpSum again you are using h1 and h2 values. what is its significance

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

      @@idriskas same question here. h is set but not used in the return so what is the point.

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

    1080p please

  • @267praveen
    @267praveen 3 ปีที่แล้ว

    The 'h' in c++ code seems redundant. It's storing the max sum including root till specific level. But your code seems to be just storing it. What is being actually returned is max of d1, d2 and maxincludingroot. I can't figure out why are you storing the value of 'h'.
    I strongly feel there is some redundancy here. Please clarify