Mark As Completed Discussion

Good evening! Here's our prompt for today.

Suppose we're given a binary tree, one with several leaves like such:

Get Binary Tree Leaves

We're asked to get all the current leaf values, then delete the leaves. Then we repeat-- we again get the leaf values, and then delete-- proceeding until we're done with the root node.

Get Binary Tree Leaves

How could we implement this in an efficient manner?

Try to solve this here or in Interactive Mode.

How do I practice this challenge?

JAVASCRIPT
OUTPUT
:001 > Cmd/Ctrl-Enter to run, Cmd/Ctrl-/ to comment

We'll now take you through what you need to know.

How do I use this guide?

Access all course materials today

The rest of this tutorial's contents are only available for premium members. Please explore your options at the link below.

Returning members can login to stop seeing this.