LeetCode 104. Maximum Depth of Binary Tree - Interview Prep Ep 65

แชร์
ฝัง
  • เผยแพร่เมื่อ 12 ก.ย. 2024
  • ⭐ Shop on Amazon to support me: www.amazon.com...
    ⭐ NordVPN to protect your online privacy: go.nordvpn.net...
    ⭐ NordPass to help manage all of your passwords: go.nordpass.io...
    LeetCode 104. Maximum Depth of Binary Tree: leetcode.com/p...
    ⭐ Support my channel and connect with me:
    / @fishercoder
    Solutions explained:
    Recursive solution: We'll add one to each level before traversing to its left and right children, return zero when the current node is null.
    Iterative solution: We can use two extra data structures to help us mimic what happens when the recursive program runs, one is the stack that holds the tree nodes that we'll iterate on, the other is the depths of each of the node.
    // TOOLS THAT I USE:
    ○ Memory Foam Set Keyboard Wrist Rest Pad - amzn.to/3cOGOAj
    ○ Electric Height Adjustable Standing Desk - amzn.to/2S9YexJ
    ○ Apple Magic Keyboard (Wireless, Rechargable) - amzn.to/36gy5FJ
    ○ Apple Magic Trackpad 2 (Wireless, Rechargable) - amzn.to/36ltimu
    ○ Apple MacBook Pro - amzn.to/30iSvKE
    ○ All-In One Printer - amzn.to/34etmSi
    ○ Apple AirPods Pro - amzn.to/2GpVYQf
    ○ My new favorite Apple Watch - amzn.to/2EIIUFd
    // MY FAVORITE BOOKS:
    ○ Introduction to Algorithms - amzn.to/36hxHXD
    ○ Designing Data-Intensive Applications - amzn.to/2S7snOg
    ○ Head First Java - amzn.to/2ScLDKa
    ○ Design Patterns - amzn.to/2SaGeU2
    Follow me on Github for complete LeetCode solutions: github.com/fis...
    Support me on Patreon: / fishercoder
    My ENTIRE Programming Equipment and Computer Science Bookshelf:
    www.amazon.com...
    And make sure you subscribe to my channel!
    Your comments/thoughts/questions/advice will be greatly appreciated!
    #softwareengineering #leetcode #algorithms #coding #interview #SDE #SWE #SiliconValley #programming #datastructures

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