Challenge: Free Tree
Let’s empty a binary tree. We’ll also see how we can do it in one line.
Problem
Given a binary tree, free all its nodes.
Input
A binary tree.
Output
An empty tree. ...
Let’s empty a binary tree. We’ll also see how we can do it in one line.
Given a binary tree, free all its nodes.
A binary tree.
An empty tree. ...