[Java] Leetcode 543. Diameter of Binary Tree [Binary Tree #11]

Eric Programming May 25, 2021
Video Thumbnail
Eric Programming Logo

Eric Programming

View Channel

About

Welcome to Eric Programming! This is the official second channel of @ericwtech, dedicated to helping you master the fundamentals of computer science. Here, we dive deep into: • Leetcode Problems (Step-by-step solutions) • Data Structures & Algorithms • Core Computer Science Theory My goal is to give you the skills and confidence to ace your technical interviews and level up as an engineer. Subscribe to start learning!

You May Also Like

Upgrade Your Workspace

AI-recommended products based on this video

Loading...
tomtoc 360° Protective Laptop Sleeve for 15-inch MacBook Air M4/A3241 2025, M3/A3114 2024, M2/A2941 2023, 15-inch MacBook Pro A1990 A1707, Dell XPS 15 Plus Laptop, Water-Resistant Computer Case Bag Global Recycled Standard

tomtoc 360° Protective Laptop Sleeve for 15-inch MacBook Air M4/A3241 2025, M3/A3114 2024, M2/A2941 2023, 15-inch MacBook Pro A1990 A1707, Dell XPS 15 Plus Laptop, Water-Resistant Computer Case Bag Global Recycled Standard

(12,968)
$39.55
FREE delivery Tue, Jun 17
Loading...
tomtoc 360° Protective Laptop Sleeve for 13-inch New MacBook Air M4/A3240 2025, M3/A3113, M2/A2681 M1/A2337 A2179 A1932, 13-inch MacBook Pro M2/A2686 M1/A2338, Water-Resistant Computer Case Bag Global Recycled Standard

tomtoc 360° Protective Laptop Sleeve for 13-inch New MacBook Air M4/A3240 2025, M3/A3113, M2/A2681 M1/A2337 A2179 A1932, 13-inch MacBook Pro M2/A2686 M1/A2338, Water-Resistant Computer Case Bag Global Recycled Standard

(12,952)
$36.07
PrimeFREE delivery Sat, Jun 14
100+ bought in past month
Loading...
Apple 2025 MacBook Air 13-inch Laptop with M4 chip: Built for Apple Intelligence, 16GB Unified Memory, 256GB SSD Storage, Touch ID; Sky Blue - English Keyboard

Apple 2025 MacBook Air 13-inch Laptop with M4 chip: Built for Apple Intelligence, 16GB Unified Memory, 256GB SSD Storage, Touch ID; Sky Blue - English Keyboard

(687)
$1,249.99
PrimeFREE delivery Sat, Jun 14
100+ bought in past month
Loading...
Logitech G203 Wired Gaming Mouse, 8,000 DPI, Rainbow Optical Effect LIGHTSYNC RGB, 6 Programmable Buttons, On-Board Memory, Screen Mapping, PC/Mac Computer and Laptop Compatible - Black
Best Seller

Logitech G203 Wired Gaming Mouse, 8,000 DPI, Rainbow Optical Effect LIGHTSYNC RGB, 6 Programmable Buttons, On-Board Memory, Screen Mapping, PC/Mac Computer and Laptop Compatible - Black

(17,871)
$27.98$22.38
FREE delivery Tue, Oct 14 on your first order
500+ bought in past month
Loading...
Logitech G305 LIGHTSPEED Wireless Gaming Mouse, Hero 12K Sensor, 12,000 DPI, Lightweight, 6 Programmable Buttons, 250h Battery Life, On-Board Memory, PC/Mac - Black

Logitech G305 LIGHTSPEED Wireless Gaming Mouse, Hero 12K Sensor, 12,000 DPI, Lightweight, 6 Programmable Buttons, 250h Battery Life, On-Board Memory, PC/Mac - Black

(21,223)
$44.98
FREE delivery Tue, Oct 14
1K+ bought in past month
Loading...
3 in 1 Charging Station for iPhone, Wireless Charger for iPhone 16 15 14 13 12 11 X Pro Max & Apple Watch - Charging Stand Dock for AirPods Global Recycled Standard

3 in 1 Charging Station for iPhone, Wireless Charger for iPhone 16 15 14 13 12 11 X Pro Max & Apple Watch - Charging Stand Dock for AirPods Global Recycled Standard

(30,415)
$30.39
Prime
1K+ bought in past month
Loading...
3 in 1 Charging Station for iPhone, Wireless Charger for iPhone 16 15 14 13 12 11 X Pro Max & Apple Watch - Charging Stand Dock for AirPods (Blue) Global Recycled Standard

3 in 1 Charging Station for iPhone, Wireless Charger for iPhone 16 15 14 13 12 11 X Pro Max & Apple Watch - Charging Stand Dock for AirPods (Blue) Global Recycled Standard

(27,328)
$39.99
PrimeFREE delivery Sat, Jun 14
100+ bought in past month
Loading...
Wireless Charger for Samsung - NANAMI 3 in 1 Charging Station for Multiple Devices,Fast Charger Stand Dock for Galaxy S25 S24 S23 Ultra S22 S21 S20 Z Flip Fold,Galaxy Watch 5/5 Pro/4/3,Galaxy Buds Pro

Wireless Charger for Samsung - NANAMI 3 in 1 Charging Station for Multiple Devices,Fast Charger Stand Dock for Galaxy S25 S24 S23 Ultra S22 S21 S20 Z Flip Fold,Galaxy Watch 5/5 Pro/4/3,Galaxy Buds Pro

(2,272)
$43.99
PrimeFREE delivery Sat, Jun 14
200+ bought in past month
Loading...
Magnetic Wireless Charger for iPhone: Fodable 3 in 1 Charging Station for Multiple Apple Devices - Travel Charging Pad Dock for Apple Watch iPhone 16 15 14 13 12 Pro Max Plus & Airpod Global Recycled Standard

Magnetic Wireless Charger for iPhone: Fodable 3 in 1 Charging Station for Multiple Apple Devices - Travel Charging Pad Dock for Apple Watch iPhone 16 15 14 13 12 Pro Max Plus & Airpod Global Recycled Standard

(656)
$49.99
PrimeFREE delivery Sat, Jun 14
100+ bought in past month
Loading...
Bose QuietComfort Wireless Noise Cancelling Headphones, Bluetooth Over Ear Headphones with Up to 24 Hours of Battery Life, Moonlight Grey - Limited Edition

Bose QuietComfort Wireless Noise Cancelling Headphones, Bluetooth Over Ear Headphones with Up to 24 Hours of Battery Life, Moonlight Grey - Limited Edition

(12,251)
$269.00
FREE delivery Tue, Oct 14
Loading...
SAMSUNG T7 Shield 4TB, Portable Solid State Drive, up-to 1050MB/s, USB 3.2 Gen2, Rugged, IP65 Water & Dust Resistant, for Photographers, Creators and Gaming, (MU-PE4T0S/AM), Black [Canada Version]

SAMSUNG T7 Shield 4TB, Portable Solid State Drive, up-to 1050MB/s, USB 3.2 Gen2, Rugged, IP65 Water & Dust Resistant, for Photographers, Creators and Gaming, (MU-PE4T0S/AM), Black [Canada Version]

(14,545)
$439.97$348.93
FREE delivery Tue, Jun 17
50+ bought in past month
Loading...
SAMSUNG T7 4TB, Portable SSD, Grey, up to 1050MB/s, USB 3.2 Gen2, Gaming, Students & Professionals, External Solid State Drive (MU-PC4T0T/AM), Grey [Canada Version]

SAMSUNG T7 4TB, Portable SSD, Grey, up to 1050MB/s, USB 3.2 Gen2, Gaming, Students & Professionals, External Solid State Drive (MU-PC4T0T/AM), Grey [Canada Version]

(35,672)
$449.97$389.00
FREE delivery Tue, Jun 17
200+ bought in past month
Loading...
Portable Steam Cleaner, Hand Held steamers for cleaning house, Home Multi Purpose-10-Piece Accessory Kit for Sofa,Carpets,Upholstery,Car,Floor,Bathroom,Mattress and More

Portable Steam Cleaner, Hand Held steamers for cleaning house, Home Multi Purpose-10-Piece Accessory Kit for Sofa,Carpets,Upholstery,Car,Floor,Bathroom,Mattress and More

(145)
$52.99
FREE delivery Wed, Jan 7
Loading...
KLONA Handheld Steam Cleaner, Steam Cleaner for Home with 10 Accessory Kit, Multipurpose Portable Upholstery Steamer Cleaning with Safety Lock to Remove Grime, Grease, and More

KLONA Handheld Steam Cleaner, Steam Cleaner for Home with 10 Accessory Kit, Multipurpose Portable Upholstery Steamer Cleaning with Safety Lock to Remove Grime, Grease, and More

(51)
$49.99
FREE delivery Mon, Jun 16
400+ bought in past month
Loading...
Rib Prep Pro Stainless Steel Rib Membrane Remover Tool, Professional BBQ Rib Skinner and Catfish Skinner Pliers, Kitchen/Grill Gadget Kit for BBQ Rib Prep, Dishwasher Safe BBQ Accessory

Rib Prep Pro Stainless Steel Rib Membrane Remover Tool, Professional BBQ Rib Skinner and Catfish Skinner Pliers, Kitchen/Grill Gadget Kit for BBQ Rib Prep, Dishwasher Safe BBQ Accessory

(0)
$18.99
$5.99 delivery Jul 2 - 22
Loading...
95 kPa Vacuum Sealer Machine, 10-IN-1 Modes Powerful Full Automatic Food Saver Vacuum Sealer with Cutter,1 Bag Roll,10 Pre-cut Bags and Accessory Hose Fully Starter Kits

95 kPa Vacuum Sealer Machine, 10-IN-1 Modes Powerful Full Automatic Food Saver Vacuum Sealer with Cutter,1 Bag Roll,10 Pre-cut Bags and Accessory Hose Fully Starter Kits

(23)
$98.99
FREE delivery Tue, Oct 28
200+ bought in past month
Loading...
Zewwen Laptop Stand for Desk, Ergonomic Adjustable Foldable Computer Stand with Heat-Vent, Aluminium Alloy Laptop Riser Compatible with MacBook Air, Pro, Dell XPS, Samsung, 10”-16"

Zewwen Laptop Stand for Desk, Ergonomic Adjustable Foldable Computer Stand with Heat-Vent, Aluminium Alloy Laptop Riser Compatible with MacBook Air, Pro, Dell XPS, Samsung, 10”-16"

(1,679)
$28.49
FREE delivery Sat, Jun 14 on your first order
500+ bought in past month
Loading...
Zewwen Laptop Stand for Desk, Ergonomic Adjustable Foldable Computer Stand with Heat-Vent, Aluminium Alloy Laptop Riser Compatible with MacBook Air, Pro, Dell XPS, Samsung, 10”-16"

Zewwen Laptop Stand for Desk, Ergonomic Adjustable Foldable Computer Stand with Heat-Vent, Aluminium Alloy Laptop Riser Compatible with MacBook Air, Pro, Dell XPS, Samsung, 10”-16"

(1,679)
$29.44
FREE delivery Sat, Jun 14 on your first order
300+ bought in past month
Loading...
llano RGB Laptop Cooling Pad with Powerful Turbofan Gaming Cooler Radiator with Infinitely Variable Speed, Touch Control, LCD Screen, 3-Port USB Hub, Seal Foam for Notebook Computer 15-19in

llano RGB Laptop Cooling Pad with Powerful Turbofan Gaming Cooler Radiator with Infinitely Variable Speed, Touch Control, LCD Screen, 3-Port USB Hub, Seal Foam for Notebook Computer 15-19in

(1,404)
$129.99
Prime
200+ bought in past month
Loading...
MOSISO Laptop Case 13 inch, 13 inch Laptop Sleeve Bag Compatible with MacBook Air 13 M4 M3 M2 M1 2025-2018 / Pro 13 M2 M1 2025-2016, Neoprene Computer Sleeve Bag with Small Case, Space Gray Global Recycled Standard

MOSISO Laptop Case 13 inch, 13 inch Laptop Sleeve Bag Compatible with MacBook Air 13 M4 M3 M2 M1 2025-2018 / Pro 13 M2 M1 2025-2016, Neoprene Computer Sleeve Bag with Small Case, Space Gray Global Recycled Standard

(20,392)
$24.29$21.88
FREE delivery Sun, Aug 10 on your first order
Loading...
MOSISO Laptop Case 13.3 inch, 13-13.3 inch Laptop Sleeve Bag Compatible with MacBook Air/Pro 13 / Pro 14, HP Dell ASUS Lenovo Notebook, Neoprene Computer Sleeve Bag with Small Case, Rock Gray Global Recycled Standard

MOSISO Laptop Case 13.3 inch, 13-13.3 inch Laptop Sleeve Bag Compatible with MacBook Air/Pro 13 / Pro 14, HP Dell ASUS Lenovo Notebook, Neoprene Computer Sleeve Bag with Small Case, Rock Gray Global Recycled Standard

(22,189)
$23.07$12.18
FREE delivery Tue, Jun 17 on your first order
Loading...
MOSISO Laptop Case 13.3 inch, 13-13.3 inch Laptop Sleeve Bag Compatible with MacBook Air/Pro 13 / Pro 14, HP Dell ASUS Lenovo Notebook, Neoprene Computer Sleeve Bag with Small Case, Black Global Recycled Standard

MOSISO Laptop Case 13.3 inch, 13-13.3 inch Laptop Sleeve Bag Compatible with MacBook Air/Pro 13 / Pro 14, HP Dell ASUS Lenovo Notebook, Neoprene Computer Sleeve Bag with Small Case, Black Global Recycled Standard

(22,184)
$22.49$20.89
FREE delivery Sat, Jun 14 on your first order
200+ bought in past month
Loading...
VersionTECH. Gaming Mouse Ergonomic Wired Computer Mouse with 7 Colors LED Backlight, 4 DPI Settings Up to 3600 DPI Compatible for Chromebook Windows 7/8/10/11 XP/Mac/Linux Gamer/Notebook/MacBook
Best Seller

VersionTECH. Gaming Mouse Ergonomic Wired Computer Mouse with 7 Colors LED Backlight, 4 DPI Settings Up to 3600 DPI Compatible for Chromebook Windows 7/8/10/11 XP/Mac/Linux Gamer/Notebook/MacBook

(15,947)
$12.79
FREE delivery Thu, Sep 11 on your first order
500+ bought in past month
Loading...
LODVIE Wireless Mouse for Laptop,2400 DPI Wireless Computer Mouse with 6 Buttons,2.4G Ergonomic USB Cordless Mouse,15 Months Battery Life Mouse for Laptop PC Mac Computer Chromebook MacBook-Black

LODVIE Wireless Mouse for Laptop,2400 DPI Wireless Computer Mouse with 6 Buttons,2.4G Ergonomic USB Cordless Mouse,15 Months Battery Life Mouse for Laptop PC Mac Computer Chromebook MacBook-Black

(7,870)
$14.99
Prime
2K+ bought in past month