LeetCode 366 | Find Leaves of Binary Tree | Solution Explained (Java + Whiteboard)

Опубликовано: 20 Апрель 2026
на канале: Xavier Elon
9,224
118

Given a binary tree, collect a tree's nodes as if you were doing this: Collect and remove all leaves, repeat until the tree is empty.

Running Time: O(N)
Space Complexity: O(N)

Always be pluggin:
Slack Channel: https://join.slack.com/t/xavierelonle...
Github: https://github.com/xavierelon1
Facebook:   / xavier.hollingsworth.3  
Instagram:   / xavierelon  
LinkedIn:   / xavier-hollingsworth-524144127  
Twitter:   / elon_xavier